- {"create", 0, 0, 'c'},
- {"append", 0, 0, 'r'},
- {"extract", 0, 0, 'x'},
- {"get", 0, 0, 'x'},
- {"list", 0, 0, 't'},
- {"update", 0, 0, 'u'},
- {"catenate", 0, 0, 'A'},
- {"concatenate", 0, 0, 'A'},
- {"compare", 0, 0, 'd'},
- {"diff", 0, 0, 'd'},
- {"delete", 0, 0, 14},
- {"help", 0, 0, 12},
-
- {"null", 0, 0, 16},
- {"directory", 1, 0, 'C'},
- {"record-number", 0, &f_sayblock, 1},
- {"files-from", 1, 0, 'T'},
- {"label", 1, 0, 'V'},
- {"exclude-from", 1, 0, 'X'},
- {"exclude", 1, 0, 15},
- {"file", 1, 0, 'f'},
- {"block-size", 1, 0, 'b'},
- {"version", 0, 0, 11},
- {"verbose", 0, 0, 'v'},
- {"totals", 0, &f_totals, 1},
-
- {"read-full-blocks", 0, &f_reblock, 1},
- {"starting-file", 1, 0, 'K'},
- {"to-stdout", 0, &f_exstdout, 1},
- {"ignore-zeros", 0, &f_ignorez, 1},
- {"keep-old-files", 0, 0, 'k'},
- {"uncompress", 0, &f_compress, 1},
- {"same-permissions", 0, &f_use_protection, 1},
- {"preserve-permissions", 0, &f_use_protection, 1},
- {"modification-time", 0, &f_modified, 1},
- {"preserve", 0, 0, 10},
- {"same-order", 0, &f_sorted_names, 1},
- {"same-owner", 0, &f_do_chown, 1},
- {"preserve-order", 0, &f_sorted_names, 1},
-
- {"newer", 1, 0, 'N'},
- {"after-date", 1, 0, 'N'},
- {"newer-mtime", 1, 0, 13},
- {"incremental", 0, 0, 'G'},
- {"listed-incremental", 1, 0, 'g'},
- {"multi-volume", 0, &f_multivol, 1},
- {"info-script", 1, 0, 'F'},
- {"absolute-paths", 0, &f_absolute_paths, 1},
- {"interactive", 0, &f_confirm, 1},
- {"confirmation", 0, &f_confirm, 1},
-
- {"verify", 0, &f_verify, 1},
- {"dereference", 0, &f_follow_links, 1},
- {"one-file-system", 0, &f_local_filesys, 1},
- {"old-archive", 0, 0, 'o'},
- {"portability", 0, 0, 'o'},
- {"compress", 0, &f_compress, 1},
- {"compress-block", 0, &f_compress, 2},
- {"sparse", 0, &f_sparse_files, 1},
- {"tape-length", 1, 0, 'L'},
- {"remove-files", 0, &f_remove_files, 1},
- {"ignore-failed-read", 0, &f_ignore_failed_read, 1},
- {"checkpoint", 0, &f_checkpoint, 1},
- {"show-omitted-dirs", 0, &f_show_omitted_dirs, 1},
- {"volno-file", 1, 0, 17},
- {"force-local", 0, &f_force_local, 1},
- {"atime-preserve", 0, &f_atime_preserve, 1},
+ ANCHORED_OPTION = CHAR_MAX + 1,
+ ATIME_PRESERVE_OPTION,
+ BACKUP_OPTION,
+ CHECKPOINT_OPTION,
+ DELETE_OPTION,
+ EXCLUDE_OPTION,
+ FORCE_LOCAL_OPTION,
+ GROUP_OPTION,
+ IGNORE_CASE_OPTION,
+ IGNORE_FAILED_READ_OPTION,
+ INDEX_FILE_OPTION,
+ MODE_OPTION,
+ NEWER_MTIME_OPTION,
+ NO_ANCHORED_OPTION,
+ NO_IGNORE_CASE_OPTION,
+ NO_OVERWRITE_DIR_OPTION,
+ NO_WILDCARDS_OPTION,
+ NO_WILDCARDS_MATCH_SLASH_OPTION,
+ NULL_OPTION,
+ NUMERIC_OWNER_OPTION,
+ OVERWRITE_OPTION,
+ OWNER_OPTION,
+ POSIX_OPTION,
+ PRESERVE_OPTION,
+ RECORD_SIZE_OPTION,
+ RECURSIVE_UNLINK_OPTION,
+ REMOVE_FILES_OPTION,
+ RSH_COMMAND_OPTION,
+ SHOW_OMITTED_DIRS_OPTION,
+ SUFFIX_OPTION,
+ TOTALS_OPTION,
+ USE_COMPRESS_PROGRAM_OPTION,
+ VOLNO_FILE_OPTION,
+ WILDCARDS_OPTION,
+ WILDCARDS_MATCH_SLASH_OPTION,
+
+ /* Some cleanup is being made in GNU tar long options. Using old names is
+ allowed for a while, but will also send a warning to stderr. Take old
+ names out in 1.14, or in summer 1997, whichever happens last. */
+
+ OBSOLETE_ABSOLUTE_NAMES,
+ OBSOLETE_BLOCK_COMPRESS,
+ OBSOLETE_BLOCKING_FACTOR,
+ OBSOLETE_BLOCK_NUMBER,
+ OBSOLETE_READ_FULL_RECORDS,
+ OBSOLETE_TOUCH,
+ OBSOLETE_VERSION_CONTROL
+};
+
+/* If nonzero, display usage information and exit. */
+static int show_help;
+
+/* If nonzero, print the version on standard output and exit. */
+static int show_version;
+
+static struct option long_options[] =
+{
+ {"absolute-names", no_argument, 0, 'P'},
+ {"absolute-paths", no_argument, 0, OBSOLETE_ABSOLUTE_NAMES},
+ {"after-date", required_argument, 0, 'N'},
+ {"anchored", no_argument, 0, ANCHORED_OPTION},
+ {"append", no_argument, 0, 'r'},
+ {"atime-preserve", no_argument, 0, ATIME_PRESERVE_OPTION},
+ {"backup", optional_argument, 0, BACKUP_OPTION},
+ {"block-compress", no_argument, 0, OBSOLETE_BLOCK_COMPRESS},
+ {"block-number", no_argument, 0, 'R'},
+ {"block-size", required_argument, 0, OBSOLETE_BLOCKING_FACTOR},
+ {"blocking-factor", required_argument, 0, 'b'},
+ {"bzip2", no_argument, 0, 'j'},
+ {"catenate", no_argument, 0, 'A'},
+ {"checkpoint", no_argument, 0, CHECKPOINT_OPTION},
+ {"compare", no_argument, 0, 'd'},
+ {"compress", no_argument, 0, 'Z'},
+ {"concatenate", no_argument, 0, 'A'},
+ {"confirmation", no_argument, 0, 'w'},
+ /* FIXME: --selective as a synonym for --confirmation? */
+ {"create", no_argument, 0, 'c'},
+ {"delete", no_argument, 0, DELETE_OPTION},
+ {"dereference", no_argument, 0, 'h'},
+ {"diff", no_argument, 0, 'd'},
+ {"directory", required_argument, 0, 'C'},
+ {"exclude", required_argument, 0, EXCLUDE_OPTION},
+ {"exclude-from", required_argument, 0, 'X'},
+ {"extract", no_argument, 0, 'x'},
+ {"file", required_argument, 0, 'f'},
+ {"files-from", required_argument, 0, 'T'},
+ {"force-local", no_argument, 0, FORCE_LOCAL_OPTION},
+ {"get", no_argument, 0, 'x'},
+ {"group", required_argument, 0, GROUP_OPTION},
+ {"gunzip", no_argument, 0, 'z'},
+ {"gzip", no_argument, 0, 'z'},
+ {"help", no_argument, &show_help, 1},
+ {"ignore-case", no_argument, 0, IGNORE_CASE_OPTION},
+ {"ignore-failed-read", no_argument, 0, IGNORE_FAILED_READ_OPTION},
+ {"ignore-zeros", no_argument, 0, 'i'},
+ /* FIXME: --ignore-end as a new name for --ignore-zeros? */
+ {"incremental", no_argument, 0, 'G'},
+ {"index-file", required_argument, 0, INDEX_FILE_OPTION},
+ {"info-script", required_argument, 0, 'F'},
+ {"interactive", no_argument, 0, 'w'},
+ {"keep-old-files", no_argument, 0, 'k'},
+ {"label", required_argument, 0, 'V'},
+ {"list", no_argument, 0, 't'},
+ {"listed-incremental", required_argument, 0, 'g'},
+ {"mode", required_argument, 0, MODE_OPTION},
+ {"modification-time", no_argument, 0, OBSOLETE_TOUCH},
+ {"multi-volume", no_argument, 0, 'M'},
+ {"new-volume-script", required_argument, 0, 'F'},
+ {"newer", required_argument, 0, 'N'},
+ {"newer-mtime", required_argument, 0, NEWER_MTIME_OPTION},
+ {"null", no_argument, 0, NULL_OPTION},
+ {"no-anchored", no_argument, 0, NO_ANCHORED_OPTION},
+ {"no-ignore-case", no_argument, 0, NO_IGNORE_CASE_OPTION},
+ {"no-overwrite-dir", no_argument, 0, NO_OVERWRITE_DIR_OPTION},
+ {"no-wildcards", no_argument, 0, NO_WILDCARDS_OPTION},
+ {"no-wildcards-match-slash", no_argument, 0, NO_WILDCARDS_MATCH_SLASH_OPTION},
+ {"no-recursion", no_argument, &recursion_option, 0},
+ {"no-same-owner", no_argument, &same_owner_option, -1},
+ {"no-same-permissions", no_argument, &same_permissions_option, -1},
+ {"numeric-owner", no_argument, 0, NUMERIC_OWNER_OPTION},
+ {"old-archive", no_argument, 0, 'o'},
+ {"one-file-system", no_argument, 0, 'l'},
+ {"overwrite", no_argument, 0, OVERWRITE_OPTION},
+ {"owner", required_argument, 0, OWNER_OPTION},
+ {"portability", no_argument, 0, 'o'},
+ {"posix", no_argument, 0, POSIX_OPTION},
+ {"preserve", no_argument, 0, PRESERVE_OPTION},
+ {"preserve-order", no_argument, 0, 's'},
+ {"preserve-permissions", no_argument, 0, 'p'},
+ {"recursion", no_argument, &recursion_option, FNM_LEADING_DIR},
+ {"recursive-unlink", no_argument, 0, RECURSIVE_UNLINK_OPTION},
+ {"read-full-blocks", no_argument, 0, OBSOLETE_READ_FULL_RECORDS},
+ {"read-full-records", no_argument, 0, 'B'},
+ /* FIXME: --partial-blocks might be a synonym for --read-full-records? */
+ {"record-number", no_argument, 0, OBSOLETE_BLOCK_NUMBER},
+ {"record-size", required_argument, 0, RECORD_SIZE_OPTION},
+ {"remove-files", no_argument, 0, REMOVE_FILES_OPTION},
+ {"rsh-command", required_argument, 0, RSH_COMMAND_OPTION},
+ {"same-order", no_argument, 0, 's'},
+ {"same-owner", no_argument, &same_owner_option, 1},
+ {"same-permissions", no_argument, 0, 'p'},
+ {"show-omitted-dirs", no_argument, 0, SHOW_OMITTED_DIRS_OPTION},
+ {"sparse", no_argument, 0, 'S'},
+ {"starting-file", required_argument, 0, 'K'},
+ {"suffix", required_argument, 0, SUFFIX_OPTION},
+ {"tape-length", required_argument, 0, 'L'},
+ {"to-stdout", no_argument, 0, 'O'},
+ {"totals", no_argument, 0, TOTALS_OPTION},
+ {"touch", no_argument, 0, 'm'},
+ {"uncompress", no_argument, 0, 'Z'},
+ {"ungzip", no_argument, 0, 'z'},
+ {"unlink-first", no_argument, 0, 'U'},
+ {"update", no_argument, 0, 'u'},
+ {"use-compress-program", required_argument, 0, USE_COMPRESS_PROGRAM_OPTION},
+ {"verbose", no_argument, 0, 'v'},
+ {"verify", no_argument, 0, 'W'},
+ {"version", no_argument, &show_version, 1},
+ {"version-control", required_argument, 0, OBSOLETE_VERSION_CONTROL},
+ {"volno-file", required_argument, 0, VOLNO_FILE_OPTION},
+ {"wildcards", no_argument, 0, WILDCARDS_OPTION},
+ {"wildcards-match-slash", no_argument, 0, WILDCARDS_MATCH_SLASH_OPTION},