X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=21d9910712ed8aea12f2bef2ea4a984e019a6f74;hb=7a5a3708cb8b33494cd6ac64bfe163f631a33edf;hp=f0d8f5bfd06643430815e94abf8bd939e04029ed;hpb=02bf3a96a931678211117534ee535863c780c6dc;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index f0d8f5b..21d9910 100644 --- a/src/tar.c +++ b/src/tar.c @@ -328,6 +328,7 @@ enum SHOW_DEFAULTS_OPTION, SHOW_OMITTED_DIRS_OPTION, SHOW_TRANSFORMED_NAMES_OPTION, + SKIP_OLD_FILES_OPTION, SPARSE_VERSION_OPTION, STRIP_COMPONENTS_OPTION, SUFFIX_OPTION, @@ -452,7 +453,11 @@ static struct argp_option options[] = { {"remove-files", REMOVE_FILES_OPTION, 0, 0, N_("remove files after adding them to the archive"), GRID+1 }, {"keep-old-files", 'k', 0, 0, - N_("don't replace existing files when extracting"), GRID+1 }, + N_("don't replace existing files when extracting, " + "treat them as errors"), GRID+1 }, + {"skip-old-files", SKIP_OLD_FILES_OPTION, 0, 0, + N_("don't replace existing files when extracting, silently skip over them"), + GRID+1 }, {"keep-newer-files", KEEP_NEWER_FILES_OPTION, 0, 0, N_("don't replace existing files that are newer than their archive copies"), GRID+1 }, {"overwrite", OVERWRITE_OPTION, 0, 0, @@ -1544,7 +1549,7 @@ parse_opt (int key, char *arg, struct argp_state *state) /* Don't replace existing files. */ old_files_option = KEEP_OLD_FILES; break; - + case 'K': starting_file_option = true; addname (arg, 0, true, NULL); @@ -1674,6 +1679,10 @@ parse_opt (int key, char *arg, struct argp_state *state) sparse_option = true; break; + case SKIP_OLD_FILES_OPTION: + old_files_option = SKIP_OLD_FILES; + break; + case SPARSE_VERSION_OPTION: sparse_option = true; {