diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-25 00:04:40 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-25 00:04:40 +0200 |
commit | 9e7a56b2119a64e30e8ac8af9e483c60976bbd37 (patch) | |
tree | f8ba13e78cb7272ed556a5801c55afda8ef6fc6a /mkfs | |
parent | d1dc5192d9cf6b439133606cca3a11ea434dee11 (diff) |
gensquashfs: Make '-X help' work without specifying input/output files
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs')
-rw-r--r-- | mkfs/mkfs.c | 6 | ||||
-rw-r--r-- | mkfs/options.c | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c index c958d73..1fd95be 100644 --- a/mkfs/mkfs.c +++ b/mkfs/mkfs.c @@ -47,12 +47,6 @@ int main(int argc, char **argv) process_command_line(&info.opt, argc, argv); - if (info.opt.comp_extra != NULL && - strcmp(info.opt.comp_extra, "help") == 0) { - compressor_print_help(info.opt.compressor); - return EXIT_SUCCESS; - } - if (sqfs_super_init(&info.super, info.opt.blksz, info.opt.def_mtime, info.opt.compressor)) { return EXIT_FAILURE; diff --git a/mkfs/options.c b/mkfs/options.c index 14c648d..36539b7 100644 --- a/mkfs/options.c +++ b/mkfs/options.c @@ -308,6 +308,11 @@ void process_command_line(options_t *opt, int argc, char **argv) } } + if (opt->comp_extra != NULL && strcmp(opt->comp_extra, "help") == 0) { + compressor_print_help(opt->compressor); + exit(EXIT_SUCCESS); + } + if ((optind + 1) >= argc) { fputs("Missing arguments: input and output files.\n", stderr); goto fail_arg; |