bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"--to" option for mv and friends


From: James R. Van Zandt
Subject: "--to" option for mv and friends
Date: Fri, 28 Aug 2009 21:48:57 -0400

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.000000000 -0400
+++ src/cp.c    2009-08-28 21:12:00.000000000 -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-directory    treat DEST as a normal file\n\
 "), stdout);
       fputs (_("\
--- ../coreutils-7.4.orig/src/install.c 2009-04-24 08:59:06.000000000 -0400
+++ src/install.c       2009-08-28 21:12:53.000000000 -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.000000000 -0400
+++ src/ln.c    2009-08-28 21:13:53.000000000 -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.000000000 -0400
+++ src/mv.c    2009-08-28 20:55:47.000000000 -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-directory    treat 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.texi    2009-05-05 17:24:31.000000000 
-0400
+++ doc/coreutils.texi  2009-08-28 21:22:37.000000000 -0400
@@ -552,8 +552,10 @@
 @macro optTargetDirectory
 @item -t @var{directory}
 @itemx @address@hidden@var{directory}}
address@hidden @address@hidden@var{directory}}
 @opindex -t
 @opindex --target-directory
address@hidden --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 can use
-the @option{--target-directory} (@option{-t}) option.
+the @option{--target-directory} (@option{--to}, @option{-t}) option.
 
 @item -t @var{directory}
 @itemx @address@hidden@var{directory}}
address@hidden @address@hidden@var{directory}}
 @opindex --target-directory
address@hidden --to
 @cindex target directory
 @cindex destination directory
 Use @var{directory} as the directory component of each destination
@@ -1221,7 +1225,7 @@
 shell command, but that requires more human labor and brain power than
 it should.)
 
-The @address@hidden (@option{-t}) option allows the @command{cp},
+The @address@hidden (@option{--to}, @option{-t}) option allows the 
@command{cp},
 @command{install}, @command{ln}, and @command{mv} programs to be used
 conveniently with @command{xargs}.  For example, you can move the files
 from the current directory to a sibling directory, @code{d} like this:
@@ -1254,7 +1258,7 @@
 @end table
 
 @noindent
-The @option{--target-directory} (@option{-t}) and
+The @option{--target-directory} (@option{--to}, @option{-t}) and
 @option{--no-target-directory} (@option{-T})
 options cannot be combined.
 
@@ -7218,7 +7222,8 @@
 second.
 
 @item
-If the @option{--target-directory} (@option{-t}) option is given, or
+If the @option{--target-directory} (@option{--to}, @option{-t}) option 
+is given, or
 failing that if the last file is a directory and the
 @option{--no-target-directory} (@option{-T}) option is not given,
 @command{cp} copies each @var{source} file to the specified directory,
@@ -7962,7 +7967,8 @@
 second.
 
 @item
-If the @option{--target-directory} (@option{-t}) option is given, or
+If the @option{--target-directory} (@option{--to}, @option{-t}) option 
+is given, or
 failing that if the last file is a directory and the
 @option{--no-target-directory} (@option{-T}) option is not given,
 @command{install} copies each @var{source} file to the specified
@@ -8132,7 +8138,8 @@
 second.
 
 @item
-If the @option{--target-directory} (@option{-t}) option is given, or
+If the @option{--target-directory} (@option{--to}, @option{-t}) 
+option is given, or
 failing that if the last file is a directory and the
 @option{--no-target-directory} (@option{-T}) option is not given,
 @command{mv} moves each @var{source} file to the specified
@@ -8714,7 +8721,8 @@
 in the current directory.
 
 @item
-If the @option{--target-directory} (@option{-t}) option is given, or
+If the @option{--target-directory} (@option{--to}, @option{-t}) option 
+is given, or
 failing that if the last file is a directory and the
 @option{--no-target-directory} (@option{-T}) option is not given,
 @command{ln} creates a link to each @var{target} file in the specified




reply via email to

[Prev in Thread] Current Thread [Next in Thread]