"--to" option for mv and friends
I propose the patch below, which adds the --to option as a synonym for --destination-directory, to the programs cp, ln, install, and mv. I think it's easier to remember (and say) something like mv --to MYDIR myfile hisfile theirfile than with the current long option. I hereby assign the copyright for this patch to the Free Software Foundation. - Jim Van Zandt --- ../coreutils-7.4.orig/src/cp.c 2009-04-24 08:50:28.0 -0400 +++ src/cp.c2009-08-28 21:12:00.0 -0400 @@ -125,6 +125,7 @@ {"suffix", required_argument, NULL, 'S'}, {"symbolic-link", no_argument, NULL, 's'}, {"target-directory", required_argument, NULL, 't'}, + {"to", required_argument, NULL, 't'}, {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -201,7 +202,8 @@ fputs (_("\ -s, --symbolic-link make symbolic links instead of copying\n\ -S, --suffix=SUFFIX override the usual backup suffix\n\ - -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n\ + -t, --to=DIRECTORY, --target-directory=DIRECTORY copy all SOURCE arguments\n\ + into DIRECTORY\n\ -T, --no-target-directorytreat DEST as a normal file\n\ "), stdout); fputs (_("\ --- ../coreutils-7.4.orig/src/install.c 2009-04-24 08:59:06.0 -0400 +++ src/install.c 2009-08-28 21:12:53.0 -0400 @@ -157,6 +157,7 @@ {"strip-program", required_argument, NULL, STRIP_PROGRAM_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, + {"to", required_argument, NULL, 't'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -980,7 +981,8 @@ -s, --strip strip symbol tables\n\ --strip-program=PROGRAM program used to strip binaries\n\ -S, --suffix=SUFFIX override the usual backup suffix\n\ - -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n\ + -t, --to=DIRECTORY, --target-directory=DIRECTORY copy all SOURCE arguments\n\ + into DIRECTORY\n\ -T, --no-target-directory treat DEST as a normal file\n\ -v, --verbose print the name of each directory as it is created\n\ "), stdout); --- ../coreutils-7.4.orig/src/ln.c 2009-04-24 08:41:19.0 -0400 +++ src/ln.c2009-08-28 21:13:53.0 -0400 @@ -103,6 +103,7 @@ {"interactive", no_argument, NULL, 'i'}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, + {"to", required_argument, NULL, 't'}, {"symbolic", no_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -383,8 +384,8 @@ "), stdout); fputs (_("\ -S, --suffix=SUFFIX override the usual backup suffix\n\ - -t, --target-directory=DIRECTORY specify the DIRECTORY in which to create\n\ -the links\n\ + -t, --to=DIRECTORY, --target-directory=DIRECTORY specify the DIRECTORY\n\ +in which to create the links\n\ -T, --no-target-directory treat LINK_NAME as a normal file\n\ -v, --verbose print name of each linked file\n\ "), stdout); --- ../coreutils-7.4.orig/src/mv.c 2009-05-03 16:05:34.0 -0400 +++ src/mv.c2009-08-28 20:55:47.0 -0400 @@ -62,6 +62,7 @@ {"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, + {"to", required_argument, NULL, 't'}, {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -304,7 +305,8 @@ -S, --suffix=SUFFIX override the usual backup suffix\n\ "), stdout); fputs (_("\ - -t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n\ + -t, --to=DIRECTORY, --target-directory=DIRECTORY move all SOURCE arguments\n\ + into DIRECTORY\n\ -T, --no-target-directorytreat DEST as a normal file\n\ -u, --update move only when the SOURCE file is newer\n\ than the destination file or when the\n\ --- ../coreutils-7.4.orig/doc/coreutils.texi2009-05-05 17:24:31.0 -0400 +++ doc/coreutils.texi 2009-08-28 21:22:37.0 -0400 @@ -552,8 +552,10 @@ @macro optTargetDirectory @item -t @var{directory} @itemx @w...@kbd{--target-directory}=@var{directory}} +...@itemx @w...@kbd{--to}=@var{directory}} @opindex -t @opindex --target-directory +...@opindex --to @cindex target directory @cindex destination directory Specify the destination @var{directory}. @@ -1195,11 +1197,13 @@ In the opposite situation, where you want the last operand to be treated as a directory and want a diagnostic otherwise, you
"--to" option for mv and friends
> I propose the patch below, which adds the --to option as a synonym for > --destination-directory, to the programs cp, ln, install, and mv. Pardon me - I should have written "--target-directory". But that is actually my point - I find the current long option hard to remember. (No, I didn't mis-type it on purpose.) Kamil Dudka wrote: > If you think the option --target-directory is too long, you can use > --ta instead I'm not trying to reduce typing. If I just wanted to minimize typing, I'd use "-t". (However, I'd first have to check the help printout to see that it's not "-T" I wanted after all. Then check the info page, because the "-T" description is so unhelpful. But that's a separate issue.) No, "-t" and certainly the abbreviation "--ta" would likely be used only by someone thoroughly familiar with the option set, who no longer has to refer to the documentation. My proposal is aimed at someone less familiar with the option set, to help him use that particular option the second time without having to refer to the documentation again. After all, "--to" makes the command read almost like an English sentence. - Jim Van Zandt
"--to" option for mv and friends
Jim Meyering wrote: > Considering all the talk of "DEST" and "destination", I can see how > the use of "target" in that option name can make it harder to remember. > A new option might be worthwhile after all. Thanks. > However, --to=... might make someone think that the > argument could be a non-directory. Well, the help entry ... --to=DIRECTORY ... makes it pretty clear. Also, the first time he tried it with a non-directory argument, it would fail with an explanation. > So how about --to-dir=..., which could still be abbreviated to --to. I'd accept that reluctantly - provided the info page includes an example using the abbreviation. (As an aside, the info page says "Most programs that accept long options recognize unambiguous abbreviations of those options", but I couldn't find any statement that mv does.) I'm attaching a revised patch along those lines. (I put the example on each program's info page, rather than on the separate "target directory" page, because I suspect each additional link loses at least half the users.) I hereby assign the copyright for this patch to the Free Software Foundation. - Jim Van Zandt --- ../coreutils-7.4.orig/src/cp.c 2009-04-24 08:50:28.0 -0400 +++ src/cp.c2009-08-30 15:05:21.0 -0400 @@ -125,6 +125,7 @@ {"suffix", required_argument, NULL, 'S'}, {"symbolic-link", no_argument, NULL, 's'}, {"target-directory", required_argument, NULL, 't'}, + {"to-dir", required_argument, NULL, 't'}, {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -201,7 +202,8 @@ fputs (_("\ -s, --symbolic-link make symbolic links instead of copying\n\ -S, --suffix=SUFFIX override the usual backup suffix\n\ - -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n\ + -t, --to-dir=DIRECTORY, --target-directory=DIRECTORY copy all SOURCE arguments\n\ + into DIRECTORY\n\ -T, --no-target-directorytreat DEST as a normal file\n\ "), stdout); fputs (_("\ --- ../coreutils-7.4.orig/src/install.c 2009-04-24 08:59:06.0 -0400 +++ src/install.c 2009-08-30 15:05:21.0 -0400 @@ -157,6 +157,7 @@ {"strip-program", required_argument, NULL, STRIP_PROGRAM_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, + {"to-dir", required_argument, NULL, 't'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, @@ -980,7 +981,8 @@ -s, --strip strip symbol tables\n\ --strip-program=PROGRAM program used to strip binaries\n\ -S, --suffix=SUFFIX override the usual backup suffix\n\ - -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n\ + -t, --to-dir=DIRECTORY, --target-directory=DIRECTORY copy all SOURCE arguments\n\ + into DIRECTORY\n\ -T, --no-target-directory treat DEST as a normal file\n\ -v, --verbose print the name of each directory as it is created\n\ "), stdout); --- ../coreutils-7.4.orig/src/ln.c 2009-04-24 08:41:19.0 -0400 +++ src/ln.c2009-08-30 15:05:21.0 -0400 @@ -103,6 +103,7 @@ {"interactive", no_argument, NULL, 'i'}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, + {"to-dir", required_argument, NULL, 't'}, {"symbolic", no_argument, NULL, 's'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -383,8 +384,8 @@ "), stdout); fputs (_("\ -S, --suffix=SUFFIX override the usual backup suffix\n\ - -t, --target-directory=DIRECTORY specify the DIRECTORY in which to create\n\ -the links\n\ + -t, --to-dir=DIRECTORY, --target-directory=DIRECTORY specify the DIRECTORY\n\ +in which to create the links\n\ -T, --no-target-directory treat LINK_NAME as a normal file\n\ -v, --verbose print name of each linked file\n\ "), stdout); --- ../coreutils-7.4.orig/src/mv.c 2009-05-03 16:05:34.0 -0400 +++ src/mv.c2009-08-30 15:05:21.0 -0400 @@ -62,6 +62,7 @@ {"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, + {"to-dir", required_argument, NULL, 't'}, {"update", no_argument, NULL, 'u'}, {"verbose", no_argument, NULL, 'v'}, {GETOPT_HELP_OPTION_DECL}, @@ -304,7 +305,8 @@ -S, --suffix=SUFFIX override the usual backup suffix\n\ "), stdout); fputs (_("\ - -t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n\ + -t, --to-dir=DIRECTORY, --target-directory=DIRECTORY move all SOURCE arguments\n\ + into DIRECTORY\n\ -T, --no-target-directorytreat DE
Re: "--to" option for mv and friends
James R. Van Zandt wrote: > I propose the patch below, which adds the --to option as a synonym for > --destination-directory, to the programs cp, ln, install, and mv. > > I think it's easier to remember (and say) something like > > mv --to MYDIR myfile hisfile theirfile While "--to" might be better than "--target-directory" or "-t", the latter has been used for ages. Having two ways to do the same thing will only be more confusing for end users I think. cheers, Pádraig.
Re: "--to" option for mv and friends
On Saturday 29 of August 2009 03:48:57 James R. Van Zandt wrote: > I propose the patch below, which adds the --to option as a synonym for > --destination-directory, to the programs cp, ln, install, and mv. > > I think it's easier to remember (and say) something like > > mv --to MYDIR myfile hisfile theirfile > > than with the current long option. Have you heard about the long option abbreviation? If you think the option --target-directory is too long, you can use --ta instead without patching anything. Genreally any abbreviation which is unambiguous enough... Kamil
Re: "--to" option for mv and friends
On Sunday 30 of August 2009 03:11:34 James R. Van Zandt wrote: > I'm not trying to reduce typing. If I just wanted to minimize typing, > I'd use "-t". (However, I'd first have to check the help printout to > see that it's not "-T" I wanted after all. Then check the info page, > because the "-T" description is so unhelpful. But that's a separate > issue.) No, "-t" and certainly the abbreviation "--ta" would likely > be used only by someone thoroughly familiar with the option set, who > no longer has to refer to the documentation. What exactly is unhelpful on the -T description? We'll be happy to improve the description if you come with something better. Kamil
Re: "--to" option for mv and friends
James R. Van Zandt wrote: >> I propose the patch below, which adds the --to option as a synonym for >> --destination-directory, to the programs cp, ln, install, and mv. > > Pardon me - I should have written "--target-directory". But that is > actually my point - I find the current long option hard to remember. > > (No, I didn't mis-type it on purpose.) > > Kamil Dudka wrote: >> If you think the option --target-directory is too long, you can use >> --ta instead > > I'm not trying to reduce typing. If I just wanted to minimize typing, > I'd use "-t". (However, I'd first have to check the help printout to > see that it's not "-T" I wanted after all. Then check the info page, > because the "-T" description is so unhelpful. But that's a separate > issue.) No, "-t" and certainly the abbreviation "--ta" would likely > be used only by someone thoroughly familiar with the option set, who > no longer has to refer to the documentation. > > My proposal is aimed at someone less familiar with the option set, to > help him use that particular option the second time without having to > refer to the documentation again. > > After all, "--to" makes the command read almost like an English sentence. Considering all the talk of "DEST" and "destination", I can see how the use of "target" in that option name can make it harder to remember. A new option might be worthwhile after all. However, --to=... might make someone think that the argument could be a non-directory. So how about --to-dir=..., which could still be abbreviated to --to. (I was tempted by --destdir, but that would impinge on the long-option namespace of --dereference)