X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=6c327f707def2bf3f7109e80bc676f2b10a2f68a;hb=d28eee6b4f16d0fb847ee57771a42062259405b8;hp=5a4ed60ee6090d1529ad73fe38daf11ee3d1dd77;hpb=751b61ab25ddc03510a695d55a916943aea2f6f0;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index 5a4ed60..6c327f7 100644 --- a/src/tar.c +++ b/src/tar.c @@ -286,6 +286,7 @@ enum IGNORE_COMMAND_ERROR_OPTION, IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, + KEEP_DIRECTORY_SYMLINK_OPTION, KEEP_NEWER_FILES_OPTION, LEVEL_OPTION, LZIP_OPTION, @@ -485,6 +486,9 @@ static struct argp_option options[] = { {"overwrite-dir", OVERWRITE_DIR_OPTION, 0, 0, N_("overwrite metadata of existing directories when extracting (default)"), GRID+1 }, + {"keep-directory-symlink", KEEP_DIRECTORY_SYMLINK_OPTION, 0, 0, + N_("preserve existing symlinks to directories when extracting"), + GRID+1 }, #undef GRID #define GRID 40 @@ -970,7 +974,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' or '--test-label' option"))); + _("You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option"))); subcommand_option = subcommand; } @@ -1767,6 +1771,10 @@ parse_opt (int key, char *arg, struct argp_state *state) ignore_failed_read_option = true; break; + case KEEP_DIRECTORY_SYMLINK_OPTION: + keep_directory_symlink_option = true; + break; + case KEEP_NEWER_FILES_OPTION: old_files_option = KEEP_NEWER_FILES; break;