- Copyright 1988, 92,93,94,95,96,97, 1999 Free Software Foundation, Inc.
+ Copyright 1988, 92,93,94,95,96,97,99, 2000 Free Software Foundation, Inc.
Written by John Gilmore, starting 1985-08-25.
This program is free software; you can redistribute it and/or modify it
Written by John Gilmore, starting 1985-08-25.
This program is free software; you can redistribute it and/or modify it
-/*--------------------------------------------------------.
-| Returns true if and only if the user typed 'y' or 'Y'. |
-`--------------------------------------------------------*/
-
+/* Returns true if and only if the user typed 'y' or 'Y'. */
- fprintf (stdlis, "%s %s?", message_action, message_name);
+ fprintf (stdlis, "%s %s?", message_action, quote (message_name));
{
{"absolute-names", no_argument, 0, 'P'},
{"absolute-paths", no_argument, 0, OBSOLETE_ABSOLUTE_NAMES},
{
{"absolute-names", no_argument, 0, 'P'},
{"absolute-paths", no_argument, 0, OBSOLETE_ABSOLUTE_NAMES},
{"block-number", no_argument, 0, 'R'},
{"block-size", required_argument, 0, OBSOLETE_BLOCKING_FACTOR},
{"blocking-factor", required_argument, 0, 'b'},
{"block-number", no_argument, 0, 'R'},
{"block-size", required_argument, 0, OBSOLETE_BLOCKING_FACTOR},
{"blocking-factor", required_argument, 0, 'b'},
- {"bzip2", no_argument, 0, 'I'},
+ {"bzip2", no_argument, 0, 'j'},
{"catenate", no_argument, 0, 'A'},
{"checkpoint", no_argument, &checkpoint_option, 1},
{"compare", no_argument, 0, 'd'},
{"catenate", no_argument, 0, 'A'},
{"checkpoint", no_argument, &checkpoint_option, 1},
{"compare", no_argument, 0, 'd'},
{"numeric-owner", no_argument, &numeric_owner_option, 1},
{"old-archive", no_argument, 0, 'o'},
{"one-file-system", no_argument, 0, 'l'},
{"numeric-owner", no_argument, &numeric_owner_option, 1},
{"old-archive", no_argument, 0, 'o'},
{"one-file-system", no_argument, 0, 'l'},
{"owner", required_argument, 0, OWNER_OPTION},
{"portability", no_argument, 0, 'o'},
{"posix", no_argument, 0, POSIX_OPTION},
{"owner", required_argument, 0, OWNER_OPTION},
{"portability", no_argument, 0, 'o'},
{"posix", no_argument, 0, POSIX_OPTION},
Operation modifiers:\n\
-W, --verify attempt to verify the archive after writing it\n\
--remove-files remove files after adding them to the archive\n\
Operation modifiers:\n\
-W, --verify attempt to verify the archive after writing it\n\
--remove-files remove files after adding them to the archive\n\
-U, --unlink-first remove each file prior to extracting over it\n\
--recursive-unlink empty hierarchies prior to extracting directory\n\
-S, --sparse handle sparse files efficiently\n\
-U, --unlink-first remove each file prior to extracting over it\n\
--recursive-unlink empty hierarchies prior to extracting directory\n\
-S, --sparse handle sparse files efficiently\n\
PATTERN at list/extract time, a globbing PATTERN\n\
-o, --old-archive, --portability write a V7 format archive\n\
--posix write a POSIX format archive\n\
PATTERN at list/extract time, a globbing PATTERN\n\
-o, --old-archive, --portability write a V7 format archive\n\
--posix write a POSIX format archive\n\
-z, --gzip, --ungzip filter the archive through gzip\n\
-Z, --compress, --uncompress filter the archive through compress\n\
--use-compress-program=PROG filter through PROG (must accept -d)\n"),
-z, --gzip, --ungzip filter the archive through gzip\n\
-Z, --compress, --uncompress filter the archive through compress\n\
--use-compress-program=PROG filter through PROG (must accept -d)\n"),
--null -T reads null-terminated names, disable -C\n\
--exclude=PATTERN exclude files, given as a globbing PATTERN\n\
-X, --exclude-from=FILE exclude globbing patterns listed in FILE\n\
--null -T reads null-terminated names, disable -C\n\
--exclude=PATTERN exclude files, given as a globbing PATTERN\n\
-X, --exclude-from=FILE exclude globbing patterns listed in FILE\n\
+ e exit immediately with a nonzero exit status if unexpected errors occur
+ E use extended headers (draft POSIX headers, that is)
+ n the archive is quickly seekable, so don't worry about random seeks
+ q stop after extracting the first occurrence of the named file
while (optchar = getopt_long (argc, argv, OPTION_STRING, long_options, 0),
optchar != -1)
switch (optchar)
while (optchar = getopt_long (argc, argv, OPTION_STRING, long_options, 0),
optchar != -1)
switch (optchar)
- USAGE_ERROR ((0, 0, _("Invalid blocking factor")));
+ USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
+ _("Invalid blocking factor")));
{
uintmax_t u;
if (xstrtoumax (optarg, 0, 10, &u, "") != LONGINT_OK)
{
uintmax_t u;
if (xstrtoumax (optarg, 0, 10, &u, "") != LONGINT_OK)
- USAGE_ERROR ((0, 0, _("Invalid tape length")));
+ USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
+ _("Invalid tape length")));
newer_mtime_option = get_date (optarg, 0);
if (newer_mtime_option == (time_t) -1)
newer_mtime_option = get_date (optarg, 0);
if (newer_mtime_option == (time_t) -1)
- WARN ((0, 0, _("Substituting %s for unknown date format `%s'"),
- tartime (newer_mtime_option), optarg));
+ WARN ((0, 0, _("Substituting %s for unknown date format %s"),
+ tartime (newer_mtime_option), quote (optarg)));
case 'X':
if (add_exclude_file (add_filtered_exclude, 0, optarg, '\n') != 0)
case 'X':
if (add_exclude_file (add_filtered_exclude, 0, optarg, '\n') != 0)
- FATAL_ERROR ((0, errno, "%s", optarg));
+ {
+ int e = errno;
+ FATAL_ERROR ((0, e, "%s", quotearg_colon (optarg)));
+ }
- FATAL_ERROR ((0, 0, _("Invalid group given on option")));
+ FATAL_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
+ _("%s: Invalid group")));
if (mode_option == MODE_INVALID)
FATAL_ERROR ((0, 0, _("Invalid mode given on option")));
if (mode_option == MODE_MEMORY_EXHAUSTED)
if (mode_option == MODE_INVALID)
FATAL_ERROR ((0, 0, _("Invalid mode given on option")));
if (mode_option == MODE_MEMORY_EXHAUSTED)
case OWNER_OPTION:
if (! (strlen (optarg) < UNAME_FIELD_SIZE
&& uname_to_uid (optarg, &owner_option)))
case OWNER_OPTION:
if (! (strlen (optarg) < UNAME_FIELD_SIZE
&& uname_to_uid (optarg, &owner_option)))
- FATAL_ERROR ((0, 0, _("Invalid owner given on option")));
+ FATAL_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
+ _("Invalid owner")));
uintmax_t u;
if (! (xstrtoumax (optarg, 0, 10, &u, "") == LONGINT_OK
&& u == (size_t) u))
uintmax_t u;
if (! (xstrtoumax (optarg, 0, 10, &u, "") == LONGINT_OK
&& u == (size_t) u))
- USAGE_ERROR ((0, 0, _("Invalid record size")));
+ USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (optarg),
+ _("Invalid record size")));
record_size = u;
if (record_size % BLOCKSIZE != 0)
USAGE_ERROR ((0, 0, _("Record size must be a multiple of %d."),
record_size = u;
if (record_size % BLOCKSIZE != 0)
USAGE_ERROR ((0, 0, _("Record size must be a multiple of %d."),
if (show_version)
{
printf ("tar (GNU %s) %s\n%s\n%s\n%s\n", PACKAGE, VERSION,
if (show_version)
{
printf ("tar (GNU %s) %s\n%s\n%s\n%s\n", PACKAGE, VERSION,
_("\
This program comes with NO WARRANTY, to the extent permitted by law.\n\
You may redistribute it under the terms of the GNU General Public License;\n\
_("\
This program comes with NO WARRANTY, to the extent permitted by law.\n\
You may redistribute it under the terms of the GNU General Public License;\n\
/* If ready to unlink hierarchies, so we are for simpler files. */
if (recursive_unlink_option)
/* If ready to unlink hierarchies, so we are for simpler files. */
if (recursive_unlink_option)
/* Forbid using -c with no input files whatsoever. Check that `-f -',
explicit or implied, is used correctly. */
/* Forbid using -c with no input files whatsoever. Check that `-f -',
explicit or implied, is used correctly. */