upstream: from tim: - for reput, it is remote-path which is

optional, not local-path - sync help

from deraadt:
- prefer -R and undocument -r (but add a comment for future editors)

from schwarze:
- prefer -p and undocument -P (as above. the comment was schwarze's too)

more:
- add the -f flag to reput and reget
- sort help (i can;t remember who suggested this originally)

djm and deraadt were ok with earlier versions of this;
tim and schwarze ok

OpenBSD-Commit-ID: 3c699b53b46111f5c57eed4533f132e7e58bacdd
This commit is contained in:
jmc@openbsd.org 2019-06-19 20:12:44 +00:00 committed by Damien Miller
parent 99bcbbc77f
commit 5f68ab436b
2 changed files with 30 additions and 22 deletions

42
sftp.1
View File

@ -1,4 +1,4 @@
.\" $OpenBSD: sftp.1,v 1.126 2019/06/12 11:31:50 jmc Exp $ .\" $OpenBSD: sftp.1,v 1.127 2019/06/19 20:12:44 jmc Exp $
.\" .\"
.\" Copyright (c) 2001 Damien Miller. All rights reserved. .\" Copyright (c) 2001 Damien Miller. All rights reserved.
.\" .\"
@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd $Mdocdate: June 12 2019 $ .Dd $Mdocdate: June 19 2019 $
.Dt SFTP 1 .Dt SFTP 1
.Os .Os
.Sh NAME .Sh NAME
@ -404,7 +404,7 @@ extension.
Quit Quit
.Nm sftp . .Nm sftp .
.It Xo Ic get .It Xo Ic get
.Op Fl afPpr .Op Fl afpR
.Ar remote-path .Ar remote-path
.Op Ar local-path .Op Ar local-path
.Xc .Xc
@ -439,15 +439,19 @@ flag is specified, then
will be called after the file transfer has completed to flush the file will be called after the file transfer has completed to flush the file
to disk. to disk.
.Pp .Pp
If either the If the
.Fl P
or
.Fl p .Fl p
.\" undocumented redundant alias
.\" or
.\" .Fl P
flag is specified, then full file permissions and access times are flag is specified, then full file permissions and access times are
copied too. copied too.
.Pp .Pp
If the If the
.Fl r .Fl R
.\" undocumented redundant alias
.\" or
.\" .Fl r
flag is specified then directories will be copied recursively. flag is specified then directories will be copied recursively.
Note that Note that
.Nm .Nm
@ -545,7 +549,7 @@ Create remote directory specified by
.It Ic progress .It Ic progress
Toggle display of progress meter. Toggle display of progress meter.
.It Xo Ic put .It Xo Ic put
.Op Fl afPpr .Op Fl afpR
.Ar local-path .Ar local-path
.Op Ar remote-path .Op Ar remote-path
.Xc .Xc
@ -581,15 +585,19 @@ after the file has been transferred.
Note that this is only supported by servers that implement Note that this is only supported by servers that implement
the "fsync@openssh.com" extension. the "fsync@openssh.com" extension.
.Pp .Pp
If either the If the
.Fl P
or
.Fl p .Fl p
.\" undocumented redundant alias
.\" or
.\" .Fl P
flag is specified, then full file permissions and access times are flag is specified, then full file permissions and access times are
copied too. copied too.
.Pp .Pp
If the If the
.Fl r .Fl R
.\" undocumented redundant alias
.\" or
.\" .Fl r
flag is specified then directories will be copied recursively. flag is specified then directories will be copied recursively.
Note that Note that
.Nm .Nm
@ -600,7 +608,7 @@ Display remote working directory.
Quit Quit
.Nm sftp . .Nm sftp .
.It Xo Ic reget .It Xo Ic reget
.Op Fl Ppr .Op Fl fpR
.Ar remote-path .Ar remote-path
.Op Ar local-path .Op Ar local-path
.Xc .Xc
@ -612,12 +620,12 @@ with the
.Fl a .Fl a
flag set. flag set.
.It Xo Ic reput .It Xo Ic reput
.Op Fl Ppr .Op Fl fpR
.Op Ar local-path .Ar local-path
.Ar remote-path .Op Ar remote-path
.Xc .Xc
Resume upload of Resume upload of
.Op Ar local-path . .Ar local-path .
Equivalent to Equivalent to
.Ic put .Ic put
with the with the

10
sftp.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: sftp.c,v 1.192 2019/06/07 03:47:12 dtucker Exp $ */ /* $OpenBSD: sftp.c,v 1.193 2019/06/19 20:12:44 jmc Exp $ */
/* /*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
* *
@ -284,9 +284,7 @@ help(void)
"df [-hi] [path] Display statistics for current directory or\n" "df [-hi] [path] Display statistics for current directory or\n"
" filesystem containing 'path'\n" " filesystem containing 'path'\n"
"exit Quit sftp\n" "exit Quit sftp\n"
"get [-afPpRr] remote [local] Download file\n" "get [-afpR] remote [local] Download file\n"
"reget [-fPpRr] remote [local] Resume download file\n"
"reput [-fPpRr] [local] remote Resume upload file\n"
"help Display this help text\n" "help Display this help text\n"
"lcd path Change local directory to 'path'\n" "lcd path Change local directory to 'path'\n"
"lls [ls-options [path]] Display local directory listing\n" "lls [ls-options [path]] Display local directory listing\n"
@ -297,10 +295,12 @@ help(void)
"lumask umask Set local umask to 'umask'\n" "lumask umask Set local umask to 'umask'\n"
"mkdir path Create remote directory\n" "mkdir path Create remote directory\n"
"progress Toggle display of progress meter\n" "progress Toggle display of progress meter\n"
"put [-afPpRr] local [remote] Upload file\n" "put [-afpR] local [remote] Upload file\n"
"pwd Display remote working directory\n" "pwd Display remote working directory\n"
"quit Quit sftp\n" "quit Quit sftp\n"
"reget [-fpR] remote [local] Resume download file\n"
"rename oldpath newpath Rename remote file\n" "rename oldpath newpath Rename remote file\n"
"reput [-fpR] local [remote] Resume upload file\n"
"rm path Delete remote file\n" "rm path Delete remote file\n"
"rmdir path Remove remote directory\n" "rmdir path Remove remote directory\n"
"symlink oldpath newpath Symlink remote file\n" "symlink oldpath newpath Symlink remote file\n"