Hi,

Christian Weisgerber wrote on Sat, Mar 30, 2019 at 10:34:59AM -0000:
> On 2019-03-30, Jason McIntyre <[email protected]> wrote:
 
>> we could use: [--del[ete]]
>> that looks ugly, but is short and clear. kind of vi(1) style.
>>
>> we could just note in the description of --delete that it can be
>> abbreviated to --del. that would add the least amount of text, but not
>> show up in usage/synopsis.
>>
>> what do you think?

> I think that if openrsync ever grows anywhere near the number of options
> that the GPL rsync has, listing them all in usage/synopsis will be
> unfeasible.

GPL rsync currently has some 85-90 long options without short aliases,
so you are right this might cause trouble in the future, but we can
deal with that once the problem arises.  We are still far away from
that point.

> Meanwhile I have no objection to your suggestion.

In general, i recommend only listing long options in the SYNOPSIS
and usage() when they have no short alias, the reason being that
long options are useless in the first place when they have a short
alias, and another reason being that not listing them makes the
synopsis shorter and more palatable (even though a synopsis with
long options is never beautiful, but that can't be helped).

In the same vein, i recommend not listing long options that have
shorter aliases, i.e. list --del, but not --delete.

So i consider the following an improvement, also dropping some
useless repetitions of .Fl macros.  Besides, this patch buys us
additional time until the synopsis might become longer than acceptable.
Maybe it even offers a chance that it never will.

OK?
  Ingo

P.S.
I feel tempted to even delete --devices and --specials from the
synopsis because they provide little benefit compared to -D.  But
i didn't include that in the patch to avoid muddling the waters.
The patch is strictly systematic, whereas deleting --devices
and --specials would be a judgement call.


Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/rsync/main.c,v
retrieving revision 1.39
diff -u -p -r1.39 main.c
--- main.c      30 Mar 2019 09:55:05 -0000      1.39
+++ main.c      30 Mar 2019 13:05:13 -0000
@@ -499,11 +499,9 @@ main(int argc, char *argv[])
        exit(rc);
 usage:
        fprintf(stderr,
-           "usage: %s [-aDglnoprtvz] [-e program] [--archive] [--compress]\n"
-           "\t[--del] [--delete] [--devices] [--group] [--links] [--dry-run]\n"
-           "\t[--owner] [--perms] [--port=portnumber] [--recursive]\n"
-           "\t[--rsh=program][--rsync-path=program] [--specials] [--times]\n"
-           "\t[--verbose] [--version] source ... directory\n",
+           "usage: %s [-aDglnoprtv] [-e program] [--del] [--devices]\n"
+           "\t[--port=portnumber] [--rsync-path=program] [--specials]\n"
+           "\t[--version] source ... directory\n",
            getprogname());
        exit(1);
 }
Index: rsync.1
===================================================================
RCS file: /cvs/src/usr.bin/rsync/rsync.1,v
retrieving revision 1.13
diff -u -p -r1.13 rsync.1
--- rsync.1     30 Mar 2019 09:32:54 -0000      1.13
+++ rsync.1     30 Mar 2019 13:05:13 -0000
@@ -24,22 +24,11 @@
 .Nm openrsync
 .Op Fl aDglnoprtv
 .Op Fl e Ar program
-.Op Fl -archive
 .Op Fl -del
-.Op Fl -delete
 .Op Fl -devices
-.Op Fl -group
-.Op Fl -links
-.Op Fl -dry-run
-.Op Fl -owner
-.Op Fl -perms
 .Op Fl -port Ns = Ns Ar portnumber
-.Op Fl -recursive
-.Op Fl -rsh Ns = Ns Ar program
 .Op Fl -rsync-path Ns = Ns Ar program
 .Op Fl -specials
-.Op Fl -times
-.Op Fl -verbose
 .Op Fl -version
 .Ar source ...
 .Ar directory
@@ -59,7 +48,7 @@ may be remote,
 but not both.
 The arguments are as follows:
 .Bl -tag -width Ds
-.It Fl a , Fl -archive
+.It Fl a , -archive
 Archive mode.
 Shorthand for
 .Fl Dgloprt .
@@ -80,7 +69,7 @@ Transfer device files.
 .It Fl e Ar program , Fl -rsh Ns = Ns Ar program
 Specify alternative program, defaults to
 .Xr ssh 1 .
-.It Fl g , Fl -group
+.It Fl g , -group
 Set group identifier to match the source.
 Groups are matched by name: group
 .Qq kristaps
@@ -89,24 +78,24 @@ with id 1000 on a remote server will be 
 on the local machine with id 2000.
 If the sender's group is unknown on the local machine, it is used
 verbatim.
-.It Fl l , Fl -links
+.It Fl l , -links
 Transfer symbolic links.
 The link is transferred as a standalone file: if the destination does
 not exist, it will be broken.
-.It Fl n , Fl -dry-run
+.It Fl n , -dry-run
 Dry-run mode.
 Does not actually modify the destination.
-.It Fl o , Fl -owner
+.It Fl o , -owner
 Set user identifier to match the source.
 This behaves like
 .Fl g
 and only works if run as root.
-.It Fl p , Fl -perms
+.It Fl p , -perms
 Set destination file or directory permissions to match the source when
 it is updated.
 .It Fl -port Ns = Ns Ar portnumber
 Specify alternative port number.
-.It Fl r , Fl -recursive
+.It Fl r , -recursive
 If
 .Ar source
 designates a directory, synchronise the directory and the entire subtree
@@ -125,10 +114,10 @@ on the remote host instead of the defaul
 .Ar rsync .
 .It Fl -specials
 Transfer fifo and unix domain socket files.
-.It Fl t , Fl -times
+.It Fl t , -times
 Set destination file and directory modification time to match the source
 when it is updated or created.
-.It Fl v , Fl -verbose
+.It Fl v , -verbose
 Increase verbosity.
 Specify once for files being transferred, twice for specific status,
 thrice for per-file transfer information, and four times for per-file

Reply via email to