X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=170871593f2754655b247d279c062b602f8214a8;hb=0057cd6803a8fa322591a5cc7661d87ab77d9db6;hp=a1185f6cbb089f08e8d9181cbfa84f0c5869d4ee;hpb=0c6c288b5360fcdb7f9b5826d05c01ade33253f0;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index a1185f6..1708715 100644 --- a/src/tar.c +++ b/src/tar.c @@ -214,9 +214,10 @@ subcommand_string (enum subcommand c) case UPDATE_SUBCOMMAND: return "-u"; - default: - abort (); + case TEST_LABEL_SUBCOMMAND: + return "--test-label"; } + abort (); } void @@ -907,9 +908,9 @@ format_default_settings (void) archive_format_string (DEFAULT_ARCHIVE_FORMAT), DEFAULT_ARCHIVE, DEFAULT_BLOCKING, quoting_style_args[DEFAULT_QUOTING_STYLE], - DEFAULT_RMT_COMMAND, + DEFAULT_RMT_COMMAND #ifdef REMOTE_SHELL - REMOTE_SHELL + , REMOTE_SHELL #endif ); } @@ -921,7 +922,7 @@ set_subcommand_option (enum subcommand subcommand) if (subcommand_option != UNKNOWN_SUBCOMMAND && subcommand_option != subcommand) USAGE_ERROR ((0, 0, - _("You may not specify more than one `-Acdtrux' option"))); + _("You may not specify more than one `-Acdtrux' or `--test-label' option"))); subcommand_option = subcommand; } @@ -1612,8 +1613,7 @@ parse_opt (int key, char *arg, struct argp_state *state) break; case TEST_LABEL_OPTION: - set_subcommand_option (LIST_SUBCOMMAND); - test_label_option = true; + set_subcommand_option (TEST_LABEL_SUBCOMMAND); break; case 'T': @@ -2437,7 +2437,7 @@ decode_options (int argc, char **argv) old_files_option = UNLINK_FIRST_OLD_FILES; - if (test_label_option) + if (subcommand_option == TEST_LABEL_SUBCOMMAND) { /* --test-label is silent if the user has specified the label name to compare against. */ @@ -2472,6 +2472,7 @@ decode_options (int argc, char **argv) case EXTRACT_SUBCOMMAND: case LIST_SUBCOMMAND: case DIFF_SUBCOMMAND: + case TEST_LABEL_SUBCOMMAND: for (archive_name_cursor = archive_name_array; archive_name_cursor < archive_name_array + archive_names; archive_name_cursor++) @@ -2578,7 +2579,7 @@ main (int argc, char **argv) { case UNKNOWN_SUBCOMMAND: USAGE_ERROR ((0, 0, - _("You must specify one of the `-Acdtrux' options"))); + _("You must specify one of the `-Acdtrux' or `--test-label' options"))); case CAT_SUBCOMMAND: case UPDATE_SUBCOMMAND: @@ -2612,6 +2613,9 @@ main (int argc, char **argv) diff_init (); read_and (diff_archive); break; + + case TEST_LABEL_SUBCOMMAND: + test_archive_label (); } if (totals_option)