Skip to content

Commit

Permalink
recognize -k argument
Browse files Browse the repository at this point in the history
  • Loading branch information
xbarin02 committed Feb 13, 2020
1 parent 28a88c4 commit 4917b9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void print_help(char *path)
fprintf(stderr, " -d : force decompression\n");
fprintf(stderr, " -z : force compression\n");
fprintf(stderr, " -f : overwrite existing output file\n");
fprintf(stderr, " -k : keep (don't delete) input file (default)\n");
fprintf(stderr, " -h : print this message\n");
}

Expand Down Expand Up @@ -193,7 +194,7 @@ int main(int argc, char *argv[])
FILE *ostream = NULL;
int force = 0;

parse: switch (getopt(argc, argv, "zdf1h")) {
parse: switch (getopt(argc, argv, "zdf1kh")) {
case 'z':
mode = COMPRESS;
goto parse;
Expand All @@ -206,6 +207,8 @@ int main(int argc, char *argv[])
case '1':
max_layers = 1;
goto parse;
case 'k':
goto parse;
case 'h':
print_help(argv[0]);
return 0;
Expand Down

0 comments on commit 4917b9f

Please sign in to comment.