Hi Kurt,
Kurt Mosiejczuk wrote on Wed, Jan 01, 2020 at 08:21:04PM -0500:
> cp(1) uses -R for recursive copy. scp(1) uses -r. This diff adds -R
> as an alias for -r to scp(1) for those assuming consistency with cp(1).
even if cp -R and scp -r did the same thing - which, if i understand
tedu@ correctly, is not the case - i would still dislike introducing
an alias.
Aliases make documentation longer for no benefit and sometimes
also cause confusion. They also block namespace for no benefit
(or rather, option space in this case).
While it is nice when different commands can use the same options
for similar purposes, that is not always possible. And even when
it would have been possible when designing the tools in the past,
if a different decision was made back then, remaining consistent
with previous versions of the same command is usually worth more
than symmetry with a different command.
Sometimes, aliases are needed because different other operating
systems use different names and we want to be compatible with both.
But whenever they can be avoided, they should.
When working on documentation, i'm actively trying to deprecate
aliases where that is possible.
Yours,
Ingo
> Index: scp.1
> ===================================================================
> RCS file: /cvs/src/usr.bin/ssh/scp.1,v
> retrieving revision 1.87
> diff -u -p -r1.87 scp.1
> --- scp.1 30 Nov 2019 07:07:59 -0000 1.87
> +++ scp.1 2 Jan 2020 01:08:01 -0000
> @@ -215,6 +215,12 @@ Recursively copy entire directories.
> Note that
> .Nm
> follows symbolic links encountered in the tree traversal.
> +.It Fl R
> +A synonym for
> +.Fl r .
> +(To mimic the
> +.Xr cp 1
> +flag for recursive copy).
> .It Fl S Ar program
> Name of
> .Ar program
> Index: scp.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ssh/scp.c,v
> retrieving revision 1.206
> diff -u -p -r1.206 scp.c
> --- scp.c 9 Sep 2019 02:31:19 -0000 1.206
> +++ scp.c 2 Jan 2020 01:08:01 -0000
> @@ -404,7 +404,7 @@ main(int argc, char **argv)
>
> fflag = Tflag = tflag = 0;
> while ((ch = getopt(argc, argv,
> - "dfl:prtTvBCc:i:P:q12346S:o:F:J:")) != -1) {
> + "dfl:pRrtTvBCc:i:P:q12346S:o:F:J:")) != -1) {
> switch (ch) {
> /* User-visible flags. */
> case '1':
> @@ -452,6 +452,7 @@ main(int argc, char **argv)
> case 'p':
> pflag = 1;
> break;
> + case 'R':
> case 'r':
> iamrecursive = 1;
> break;