and --no-target-directory options, respectively.
(NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
Remove. All uses changed to 'T' and 't', respectively.
(long_options, main, usage): Add -t and -T as
aliases for --target-directory and --no-target-directory,
respectively.
static void strip (const char *path);
void usage (int status);
-/* For long options that have no equivalent short option, use a
- non-character as a pseudo short option, starting with CHAR_MAX + 1. */
-enum
-{
- NO_TARGET_DIRECTORY_OPTION = CHAR_MAX + 1,
- TARGET_DIRECTORY_OPTION
-};
-
/* The name this program was run with, for error messages. */
char *program_name;
{"directory", no_argument, NULL, 'd'},
{"group", required_argument, NULL, 'g'},
{"mode", required_argument, NULL, 'm'},
- {"no-target-directory", no_argument, NULL, NO_TARGET_DIRECTORY_OPTION},
+ {"no-target-directory", no_argument, NULL, 'T'},
{"owner", required_argument, NULL, 'o'},
{"preserve-timestamps", no_argument, NULL, 'p'},
{"strip", no_argument, NULL, 's'},
{"suffix", required_argument, NULL, 'S'},
- {"target-directory", required_argument, NULL, TARGET_DIRECTORY_OPTION},
+ {"target-directory", required_argument, NULL, 't'},
{"version-control", required_argument, NULL, 'V'}, /* Deprecated. FIXME. */
{"verbose", no_argument, NULL, 'v'},
{GETOPT_HELP_OPTION_DECL},
we'll actually use backup_suffix_string. */
backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
- while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pvV:S:", long_options,
+ while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvV:S:", long_options,
NULL)) != -1)
{
switch (optc)
case 'm':
specified_mode = optarg;
break;
- case NO_TARGET_DIRECTORY_OPTION:
- no_target_directory = true;
- break;
case 'o':
owner_name = optarg;
break;
make_backups = 1;
backup_suffix_string = optarg;
break;
- case TARGET_DIRECTORY_OPTION:
+ case 't':
if (target_directory)
error (EXIT_FAILURE, 0,
_("multiple target directories specified"));
}
target_directory = optarg;
break;
+ case 'T':
+ no_target_directory = true;
+ break;
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
{
if (target_directory)
error (EXIT_FAILURE, 0,
- _("Cannot combine --target-directory "
- "and --no-target-directory"));
+ _("Cannot combine --target-directory (-t) "
+ "and --no-target-directory (-T)"));
if (2 < n_files)
{
error (0, 0, _("extra operand %s"), quote (file[2]));
else
{
printf (_("\
-Usage: %s [OPTION]... SOURCE DEST (1st format)\n\
- or: %s [OPTION]... SOURCE... DIRECTORY (2nd format)\n\
- or: %s [OPTION]... --target-directory=DIRECTORY SOURCE... (3rd format)\n\
- or: %s -d [OPTION]... DIRECTORY... (4th format)\n\
+Usage: %s [OPTION]... [-T] SOURCE DEST (1st form)\n\
+ or: %s [OPTION]... SOURCE... DIRECTORY (2nd form)\n\
+ or: %s [OPTION]... -t DIRECTORY SOURCE... (3rd form)\n\
+ or: %s [OPTION]... -d DIRECTORY... (4th form)\n\
"),
program_name, program_name, program_name, program_name);
fputs (_("\
-In the first three formats, copy SOURCE to DEST or multiple SOURCE(s) to\n\
+In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to\n\
the existing DIRECTORY, while setting permission modes and owner/group.\n\
-In the fourth format, create all components of the given DIRECTORY(ies).\n\
+In the 4th form, create all components of the given DIRECTORY(ies).\n\
\n\
"), stdout);
fputs (_("\
to corresponding destination files\n\
-s, --strip strip symbol tables, only for 1st and 2nd formats\n\
-S, --suffix=SUFFIX override the usual backup suffix\n\
- --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n\
- --no-target-directory treat DEST as a normal file\n\
+ -t, --target-directory=DIRECTORY copy all SOURCE arguments 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);
fputs (HELP_OPTION_DESCRIPTION, stdout);
# define ENABLE_HARD_LINK_TO_SYMLINK_WARNING 0
#endif
-/* For long options that have no equivalent short option, use a
- non-character as a pseudo short option, starting with CHAR_MAX + 1. */
-enum
-{
- NO_TARGET_DIRECTORY_OPTION = CHAR_MAX + 1,
- TARGET_DIRECTORY_OPTION
-};
-
int link (); /* Some systems don't declare this anywhere. */
#ifdef S_ISLNK
{"backup", optional_argument, NULL, 'b'},
{"directory", no_argument, NULL, 'F'},
{"no-dereference", no_argument, NULL, 'n'},
- {"no-target-directory", no_argument, NULL, NO_TARGET_DIRECTORY_OPTION},
+ {"no-target-directory", no_argument, NULL, 'T'},
{"force", no_argument, NULL, 'f'},
{"interactive", no_argument, NULL, 'i'},
{"suffix", required_argument, NULL, 'S'},
- {"target-directory", required_argument, NULL, TARGET_DIRECTORY_OPTION},
+ {"target-directory", required_argument, NULL, 't'},
{"symbolic", no_argument, NULL, 's'},
{"verbose", no_argument, NULL, 'v'},
{"version-control", required_argument, NULL, 'V'}, /* Deprecated. FIXME. */
else
{
printf (_("\
-Usage: %s [OPTION]... TARGET [LINK_NAME]\n\
- or: %s [OPTION]... TARGET... DIRECTORY\n\
- or: %s [OPTION]... --target-directory=DIRECTORY TARGET...\n\
+Usage: %s [OPTION]... [-T] TARGET LINK_NAME (1st form)\n\
+ or: %s [OPTION]... TARGET (2nd form)\n\
+ or: %s [OPTION]... TARGET... DIRECTORY (3rd form)\n\
+ or: %s [OPTION]... -t DIRECTORY TARGET... (4th form)\n\
"),
- program_name, program_name, program_name);
+ program_name, program_name, program_name, program_name);
fputs (_("\
-Create a link to the specified TARGET with optional LINK_NAME.\n\
-If LINK_NAME is omitted, a link with the same basename as the TARGET is\n\
-created in the current directory. When using the second form with more\n\
-than one TARGET, the last argument must be a directory; create links\n\
-in DIRECTORY to each TARGET. Create hard links by default, symbolic\n\
-links with --symbolic. When creating hard links, each TARGET must exist.\n\
+In the 1st form, create a link to TARGET with the name LINK_NAME.\n\
+In the 2nd form, create a link to TARGET in the current directory.\n\
+In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.\n\
+Create hard links by default, symbolic links with --symbolic.\n\
+When creating hard links, each TARGET must exist.\n\
\n\
"), stdout);
fputs (_("\
"), stdout);
fputs (_("\
-S, --suffix=SUFFIX override the usual backup suffix\n\
- --target-directory=DIRECTORY specify the DIRECTORY in which to create\n\
+ -t, --target-directory=DIRECTORY specify the DIRECTORY in which to create\n\
the links\n\
- --no-target-directory treat LINK_NAME as a normal file\n\
+ -T, --no-target-directory treat LINK_NAME as a normal file\n\
-v, --verbose print name of each file before linking\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
= hard_dir_link = 0;
errors = 0;
- while ((c = getopt_long (argc, argv, "bdfinsvFS:V:", long_options, NULL))
+ while ((c = getopt_long (argc, argv, "bdfinst:vFS:TV:", long_options, NULL))
!= -1)
{
switch (c)
case 'n':
dereference_dest_dir_symlinks = 0;
break;
- case NO_TARGET_DIRECTORY_OPTION:
- no_target_directory = true;
- break;
case 's':
#ifdef S_ISLNK
symbolic_link = 1;
_("symbolic links are not supported on this system"));
#endif
break;
- case TARGET_DIRECTORY_OPTION:
+ case 't':
if (target_directory)
error (EXIT_FAILURE, 0, _("multiple target directories specified"));
else
}
target_directory = optarg;
break;
+ case 'T':
+ no_target_directory = true;
+ break;
case 'v':
verbose = 1;
break;
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
{
- NO_TARGET_DIRECTORY_OPTION = CHAR_MAX + 1,
- REPLY_OPTION,
- STRIP_TRAILING_SLASHES_OPTION,
- TARGET_DIRECTORY_OPTION
+ REPLY_OPTION = CHAR_MAX + 1,
+ STRIP_TRAILING_SLASHES_OPTION
};
/* The name this program was run with. */
{"backup", optional_argument, NULL, 'b'},
{"force", no_argument, NULL, 'f'},
{"interactive", no_argument, NULL, 'i'},
- {"no-target-directory", no_argument, NULL, NO_TARGET_DIRECTORY_OPTION},
+ {"no-target-directory", no_argument, NULL, 'T'},
{"reply", required_argument, NULL, REPLY_OPTION},
{"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
{"suffix", required_argument, NULL, 'S'},
- {"target-directory", required_argument, NULL, TARGET_DIRECTORY_OPTION},
+ {"target-directory", required_argument, NULL, 't'},
{"update", no_argument, NULL, 'u'},
{"verbose", no_argument, NULL, 'v'},
{"version-control", required_argument, NULL, 'V'},
else
{
printf (_("\
-Usage: %s [OPTION]... SOURCE DEST\n\
+Usage: %s [OPTION]... [-T] SOURCE DEST\n\
or: %s [OPTION]... SOURCE... DIRECTORY\n\
- or: %s [OPTION]... --target-directory=DIRECTORY SOURCE...\n\
+ or: %s [OPTION]... -t DIRECTORY SOURCE...\n\
"),
program_name, program_name, program_name);
fputs (_("\
-S, --suffix=SUFFIX override the usual backup suffix\n\
"), stdout);
fputs (_("\
- --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n\
- --no-target-directory treat DEST as a normal file\n\
+ -t, --target-directory=DIRECTORY move all SOURCE arguments 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\
destination file is missing\n\
errors = 0;
- while ((c = getopt_long (argc, argv, "bfiuvS:V:", long_options, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "bfit:uvS:TV:", long_options, NULL))
+ != -1)
{
switch (c)
{
case 'i':
x.interactive = I_ASK_USER;
break;
- case NO_TARGET_DIRECTORY_OPTION:
- no_target_directory = true;
- break;
case REPLY_OPTION:
x.interactive = XARGMATCH ("--reply", optarg,
reply_args, reply_vals);
case STRIP_TRAILING_SLASHES_OPTION:
remove_trailing_slashes = 1;
break;
- case TARGET_DIRECTORY_OPTION:
+ case 't':
if (target_directory)
error (EXIT_FAILURE, 0, _("multiple target directories specified"));
else
}
target_directory = optarg;
break;
+ case 'T':
+ no_target_directory = true;
+ break;
case 'u':
x.update = 1;
break;
{
if (target_directory)
error (EXIT_FAILURE, 0,
- _("Cannot combine --target-directory "
- "and --no-target-directory"));
+ _("Cannot combine --target-directory (-t) "
+ "and --no-target-directory (-T)"));
if (2 < n_files)
{
error (0, 0, _("extra operand %s"), quote (file[2]));