+ {"absolute-names", no_argument, NULL, 'P'},
+ {"absolute-paths", no_argument, NULL, OBSOLETE_ABSOLUTE_NAMES},
+ {"after-date", required_argument, NULL, 'N'},
+ {"append", no_argument, NULL, 'r'},
+ {"atime-preserve", no_argument, &atime_preserve_option, 1},
+ {"backup", optional_argument, NULL, BACKUP_OPTION},
+ {"block-compress", no_argument, NULL, OBSOLETE_BLOCK_COMPRESS},
+ {"block-number", no_argument, NULL, 'R'},
+ {"block-size", required_argument, NULL, OBSOLETE_BLOCKING_FACTOR},
+ {"blocking-factor", required_argument, NULL, 'b'},
+ {"catenate", no_argument, NULL, 'A'},
+ {"checkpoint", no_argument, &checkpoint_option, 1},
+ {"compare", no_argument, NULL, 'd'},
+ {"compress", no_argument, NULL, 'Z'},
+ {"concatenate", no_argument, NULL, 'A'},
+ {"confirmation", no_argument, NULL, 'w'},
+ /* FIXME: --selective as a synonym for --confirmation? */
+ {"create", no_argument, NULL, 'c'},
+ {"delete", no_argument, NULL, DELETE_OPTION},
+ {"dereference", no_argument, NULL, 'h'},
+ {"diff", no_argument, NULL, 'd'},
+ {"directory", required_argument, NULL, 'C'},
+ {"ending-file", required_argument, NULL, 'E'},
+ {"exclude", required_argument, NULL, EXCLUDE_OPTION},
+ {"exclude-from", required_argument, NULL, 'X'},
+ {"extract", no_argument, NULL, 'x'},
+ {"file", required_argument, NULL, 'f'},
+ {"files-from", required_argument, NULL, 'T'},
+ {"force-local", no_argument, &force_local_option, 1},
+ {"get", no_argument, NULL, 'x'},
+ {"group", required_argument, NULL, GROUP_OPTION},
+ {"gunzip", no_argument, NULL, 'z'},
+ {"gzip", no_argument, NULL, 'z'},
+ {"help", no_argument, &show_help, 1},
+ {"ignore-failed-read", no_argument, &ignore_failed_read_option, 1},
+ {"ignore-zeros", no_argument, NULL, 'i'},
+ /* FIXME: --ignore-end as a new name for --ignore-zeros? */
+ {"incremental", no_argument, NULL, 'G'},
+ {"info-script", required_argument, NULL, 'F'},
+ {"interactive", no_argument, NULL, 'w'},
+ {"keep-old-files", no_argument, NULL, 'k'},
+ {"label", required_argument, NULL, 'V'},
+ {"list", no_argument, NULL, 't'},
+ {"listed-incremental", required_argument, NULL, 'g'},
+ {"mode", required_argument, NULL, MODE_OPTION},
+ {"modification-time", no_argument, NULL, OBSOLETE_TOUCH},
+ {"multi-volume", no_argument, NULL, 'M'},
+ {"new-volume-script", required_argument, NULL, 'F'},
+ {"newer", required_argument, NULL, 'N'},
+ {"newer-mtime", required_argument, NULL, NEWER_MTIME_OPTION},
+ {"null", no_argument, NULL, NULL_OPTION},
+ {"no-recursion", no_argument, NULL, NO_RECURSE_OPTION},
+ {"numeric-owner", no_argument, &numeric_owner_option, 1},
+ {"old-archive", no_argument, NULL, 'o'},
+ {"one-file-system", no_argument, NULL, 'l'},
+ {"owner", required_argument, NULL, OWNER_OPTION},
+ {"portability", no_argument, NULL, 'o'},
+ {"posix", no_argument, NULL, POSIX_OPTION},
+ {"preserve", no_argument, NULL, PRESERVE_OPTION},
+ {"preserve-order", no_argument, NULL, 's'},
+ {"preserve-permissions", no_argument, NULL, 'p'},
+ {"recursive-unlink", no_argument, &recursive_unlink_option, 1},
+ {"read-full-blocks", no_argument, NULL, OBSOLETE_READ_FULL_RECORDS},
+ {"read-full-records", no_argument, NULL, 'B'},
+ /* FIXME: --partial-blocks might be a synonym for --read-full-records? */
+ {"record-number", no_argument, NULL, OBSOLETE_BLOCK_NUMBER},
+ {"record-size", required_argument, NULL, RECORD_SIZE_OPTION},
+ {"remove-files", no_argument, &remove_files_option, 1},
+ {"rsh-command", required_argument, NULL, RSH_COMMAND_OPTION},
+ {"same-order", no_argument, NULL, 's'},
+ {"same-owner", no_argument, &same_owner_option, 1},
+ {"same-permissions", no_argument, NULL, 'p'},
+ {"show-omitted-dirs", no_argument, &show_omitted_dirs_option, 1},
+ {"sparse", no_argument, NULL, 'S'},
+ {"starting-file", required_argument, NULL, 'K'},
+ {"suffix", required_argument, NULL, SUFFIX_OPTION},
+ {"tape-length", required_argument, NULL, 'L'},
+ {"to-stdout", no_argument, NULL, 'O'},
+ {"totals", no_argument, &totals_option, 1},
+ {"touch", no_argument, NULL, 'm'},
+ {"uncompress", no_argument, NULL, 'Z'},
+ {"ungzip", no_argument, NULL, 'z'},
+ {"unlink-first", no_argument, NULL, 'U'},
+ {"update", no_argument, NULL, 'u'},
+ {"use-compress-program", required_argument, NULL, USE_COMPRESS_PROGRAM_OPTION},
+ {"verbose", no_argument, NULL, 'v'},
+ {"verify", no_argument, NULL, 'W'},
+ {"version", no_argument, &show_version, 1},
+ {"version-control", required_argument, NULL, OBSOLETE_VERSION_CONTROL},
+ {"volno-file", required_argument, NULL, VOLNO_FILE_OPTION},
+
+ {0, 0, 0, 0}
+};
+
+/*---------------------------------------------.
+| Print a usage message and exit with STATUS. |
+`---------------------------------------------*/
+
+static void
+usage (int status)
+{
+ if (status != TAREXIT_SUCCESS)
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
+ program_name);
+ else
+ {
+ fputs (_("\
+GNU `tar' saves many files together into a single tape or disk archive, and\n\
+can restore individual files from the archive.\n"),
+ stdout);
+ printf (_("\nUsage: %s [OPTION]... [FILE]...\n"), program_name);
+ fputs (_("\
+\n\
+If a long option shows an argument as mandatory, then it is mandatory\n\
+for the equivalent short option also. Similarly for optional arguments.\n"),
+ stdout);
+ fputs(_("\
+\n\
+Main operation mode:\n\
+ -t, --list list the contents of an archive\n\
+ -x, --extract, --get extract files from an archive\n\
+ -c, --create create a new archive\n\
+ -d, --diff, --compare find differences between archive and file system\n\
+ -r, --append append files to the end of an archive\n\
+ -u, --update only append files newer than copy in archive\n\
+ -A, --catenate append tar files to an archive\n\
+ --concatenate same as -A\n\
+ --delete delete from the archive (not on mag tapes!)\n"),
+ stdout);
+ fputs (_("\
+\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\
+ -k, --keep-old-files don't overwrite existing files when extracting\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\
+ -O, --to-stdout extract files to standard output\n\
+ -G, --incremental handle old GNU-format incremental backup\n\
+ -g, --listed-incremental handle new GNU-format incremental backup\n\
+ --ignore-failed-read do not exit with nonzero on unreadable files\n"),
+ stdout);
+ fputs (_("\
+\n\
+Handling of file attributes:\n\
+ --owner=NAME force NAME as owner for added files\n\
+ --group=NAME force NAME as group for added files\n\
+ --mode=CHANGES force (symbolic) mode CHANGES for added files\n\
+ --atime-preserve don't change access times on dumped files\n\
+ -m, --modification-time don't extract file modified time\n\
+ --same-owner try extracting files with the same ownership\n\
+ --numeric-owner always use numbers for user/group names\n\
+ -p, --same-permissions extract all protection information\n\
+ --preserve-permissions same as -p\n\
+ -s, --same-order sort names to extract to match archive\n\
+ --preserve-order same as -s\n\
+ --preserve same as both -p and -s\n"),
+ stdout);
+ fputs (_("\
+\n\
+Device selection and switching:\n\
+ -f, --file=ARCHIVE use archive file or device ARCHIVE\n\
+ --force-local archive file is local even if has a colon\n\
+ --rsh-command=COMMAND use remote COMMAND instead of rsh\n\
+ -[0-7][lmh] specify drive and density\n\
+ -M, --multi-volume create/list/extract multi-volume archive\n\
+ -L, --tape-length=NUM change tape after writing NUM x 1024 bytes\n\
+ -F, --info-script=FILE run script at end of each tape (implies -M)\n\
+ --new-volume-script=FILE same as -F FILE\n\
+ --volno-file=FILE use/update the volume number in FILE\n"),
+ stdout);
+ fputs (_("\
+\n\
+Device blocking:\n\
+ -b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record\n\
+ --record-size=SIZE SIZE bytes per record, multiple of 512\n\
+ -i, --ignore-zeros ignore zeroed blocks in archive (means EOF)\n\
+ -B, --read-full-records reblock as we read (for 4.2BSD pipes)\n"),
+ stdout);
+ fputs (_("\
+\n\
+Archive format selection:\n\
+ -V, --label=NAME create archive with volume name NAME\n\
+ PATTERN at list/extract time, a globbing PATTERN\n\
+ -o, --old-archive, --portability write a V7 format archive\n\
+ --posix write a POSIX conformant 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"),
+ stdout);
+ fputs (_("\
+\n\
+Local file selection:\n\
+ -C, --directory=DIR change to directory DIR\n\
+ -T, --files-from=NAME get names to extract or create from file NAME\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\
+ -P, --absolute-names don't strip leading `/'s from file names\n\
+ -h, --dereference dump instead the files symlinks point to\n\
+ --no-recursion avoid descending automatically in directories\n\
+ -l, --one-file-system stay in local file system when creating archive\n\
+ -E, --ending-file=NAME end reading the archive before file NAME\n\
+ -K, --starting-file=NAME begin at file NAME in the archive\n"),
+ stdout);
+#if !MSDOS
+ fputs (_("\
+ -N, --newer=DATE only store files newer than DATE\n\
+ --newer-mtime compare date and time when data changed only\n\
+ --after-date=DATE same as -N\n"),
+ stdout);
+#endif
+ fputs (_("\
+ --backup[=CONTROL] backup before removal, choose version control\n\
+ --suffix=SUFFIX backup before removel, override usual suffix\n"),
+ stdout);
+ fputs (_("\
+\n\
+Informative output:\n\
+ --help print this help, then exit\n\
+ --version print tar program version number, then exit\n\
+ -v, --verbose verbosely list files processed\n\
+ --checkpoint print directory names while reading the archive\n\
+ --totals print total bytes written while creating archive\n\
+ -R, --block-number show block number within archive with each message\n\
+ -w, --interactive ask for confirmation for every action\n\
+ --confirmation same as -w\n"),
+ stdout);
+ fputs (_("\
+\n\
+The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
+The version control may be set with --backup or VERSION_CONTROL, values are:\n\
+\n\
+ t, numbered make numbered backups\n\
+ nil, existing numbered if numbered backups exist, simple otherwise\n\
+ never, simple always make simple backups\n"),
+ stdout);
+ printf (_("\
+\n\
+GNU tar cannot read nor produce `--posix' archives. If POSIXLY_CORRECT\n\
+is set in the environment, GNU extensions are disallowed with `--posix'.\n\
+Support for POSIX is only partially implemented, don't count on it yet.\n\
+ARCHIVE may be FILE, HOST:FILE or USER@HOST:FILE; and FILE may be a file\n\
+or a device. *This* `tar' defaults to `-f%s -b%d'.\n"),
+ DEFAULT_ARCHIVE, DEFAULT_BLOCKING);
+ fputs (_("\
+\n\
+Report bugs to <tar-bugs@gnu.ai.mit.edu>.\n"),
+ stdout);
+ }
+ exit (status);