Hi,

Jason McIntyre wrote on Mon, Jun 17, 2019 at 04:58:26PM +0100:
> On Mon, Jun 17, 2019 at 05:31:16PM +0200, Tim van der Molen wrote:
>> Jason McIntyre (2019-06-17 15:02 +0200):
>>> On Mon, Jun 17, 2019 at 02:47:09PM +0200, Tim van der Molen wrote:

>>>> sftp(1) has this:
>>>>    reput [-Ppr] [local-path] remote-path
>>>>       Resume upload of [local-path].  Equivalent to put with the -a
>>>>       flag set.
>>>> remote-path should be marked optional, not local-path. Probably a pasto
>>>> from reget.

>>> ok by me, but i have another question - shouldn;t the usage for reput
>>> and reget show the -f flag too? i know it's unrelated to your diff, but
>>> two birds and all that.

>> Yes, you're right.
>> I see there's also a -R flag (equivalent to -r), so I added that one as
>> well (it's also listed in sftp's help command).

> ok, please wait for a bit of feedback. i suspect -R is deliberately
> undocumented (maybe to mirror cp).

I seriously doubt that.  See here:

   $ sftp localhost
  schwarze@localhost's password: 
  Connected to localhost.
  sftp> help
  Available commands:
  [...]
  get [-afPpRr] remote [local]       Download file
  reget [-fPpRr] remote [local]      Resume download file
  reput [-fPpRr] [local] remote      Resume upload file

Both the -Pp and the -Rr pairs are consistently documented in the
help() string in sftp.c, so the omission of -R in the manual page
looks like an oversight.  It makes little sense to me to consistently
document -P but to be inconsistent about -R.


>> And then I noticed the help command also has the original issue. While
>> there I might as well restore alphabetical order.
>> (It's not two birds, but a can of worms!)

> it's always a can of worms.

Right, taming the worms is hard work.
In reality, they won't just grab their mothers and fly away.


Anyway, OK for the diff below.

Feel free to reconsider the alphabetical order of "reget reput rename"
if you want to.  ;-)

Yours,
  Ingo


>> Index: sftp.1
>> ===================================================================
>> RCS file: /cvs/src/usr.bin/ssh/sftp.1,v
>> retrieving revision 1.125
>> diff -p -u -r1.125 sftp.1
>> --- sftp.1   22 Jan 2019 06:58:31 -0000      1.125
>> +++ sftp.1   17 Jun 2019 15:27:11 -0000
>> @@ -404,7 +404,7 @@ extension.
>>  Quit
>>  .Nm sftp .
>>  .It Xo Ic get
>> -.Op Fl afPpr
>> +.Op Fl afPpRr
>>  .Ar remote-path
>>  .Op Ar local-path
>>  .Xc
>> @@ -446,9 +446,11 @@ or
>>  flag is specified, then full file permissions and access times are
>>  copied too.
>>  .Pp
>> -If the
>> +If either the
>> +.Fl R
>> +or
>>  .Fl r
>> -flag is specified then directories will be copied recursively.
>> +flag is specified, then directories will be copied recursively.
>>  Note that
>>  .Nm
>>  does not follow symbolic links when performing recursive transfers.
>> @@ -545,7 +547,7 @@ Create remote directory specified by
>>  .It Ic progress
>>  Toggle display of progress meter.
>>  .It Xo Ic put
>> -.Op Fl afPpr
>> +.Op Fl afPpRr
>>  .Ar local-path
>>  .Op Ar remote-path
>>  .Xc
>> @@ -588,9 +590,11 @@ or
>>  flag is specified, then full file permissions and access times are
>>  copied too.
>>  .Pp
>> -If the
>> +If either the
>> +.Fl R
>> +or
>>  .Fl r
>> -flag is specified then directories will be copied recursively.
>> +flag is specified, then directories will be copied recursively.
>>  Note that
>>  .Nm
>>  does not follow symbolic links when performing recursive transfers.
>> @@ -600,7 +604,7 @@ Display remote working directory.
>>  Quit
>>  .Nm sftp .
>>  .It Xo Ic reget
>> -.Op Fl Ppr
>> +.Op Fl fPpRr
>>  .Ar remote-path
>>  .Op Ar local-path
>>  .Xc
>> @@ -612,12 +616,12 @@ with the
>>  .Fl a
>>  flag set.
>>  .It Xo Ic reput
>> -.Op Fl Ppr
>> -.Op Ar local-path
>> -.Ar remote-path
>> +.Op Fl fPpRr
>> +.Ar local-path
>> +.Op Ar remote-path
>>  .Xc
>>  Resume upload of
>> -.Op Ar local-path .
>> +.Ar local-path .
>>  Equivalent to
>>  .Ic put
>>  with the
>> Index: sftp.c
>> ===================================================================
>> RCS file: /cvs/src/usr.bin/ssh/sftp.c,v
>> retrieving revision 1.192
>> diff -p -u -r1.192 sftp.c
>> --- sftp.c   7 Jun 2019 03:47:12 -0000       1.192
>> +++ sftp.c   17 Jun 2019 15:27:11 -0000
>> @@ -263,8 +263,6 @@ help(void)
>>          "                                   filesystem containing 'path'\n"
>>          "exit                               Quit sftp\n"
>>          "get [-afPpRr] 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"
>>          "lcd path                           Change local directory to 
>> 'path'\n"
>>          "lls [ls-options [path]]            Display local directory 
>> listing\n"
>> @@ -278,6 +276,8 @@ help(void)
>>          "put [-afPpRr] local [remote]       Upload file\n"
>>          "pwd                                Display remote working 
>> directory\n"
>>          "quit                               Quit sftp\n"
>> +        "reget [-fPpRr] remote [local]      Resume download file\n"
>> +        "reput [-fPpRr] local [remote]      Resume upload file\n"
>>          "rename oldpath newpath             Rename remote file\n"
>>          "rm path                            Delete remote file\n"
>>          "rmdir path                         Remove remote directory\n"

Reply via email to