1
0
mirror of https://github.com/kdave/btrfs-progs synced 2025-04-06 17:21:57 +00:00

btrfs-progs: check: unify handling of unrecognized options

Use the right helper for unrecognized options so only the unknown one is
printed instead of the whole help text. Also move the case to the end as
is common elsewhere.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2024-04-05 02:47:04 +02:00
parent 29b40262ba
commit f742e237e8

View File

@ -10189,9 +10189,6 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
case 'p':
g_task_ctx.progress_enabled = true;
break;
case '?':
case 'h':
usage(cmd, 0);
case GETOPT_VAL_REPAIR:
printf("enabling repair mode\n");
opt_check_repair = 1;
@ -10242,11 +10239,14 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
case GETOPT_VAL_FORCE:
force = 1;
break;
case '?':
case 'h':
usage_unknown_option(cmd, argv);
}
}
if (check_argc_exact(argc - optind, 1))
usage(cmd, 1);
return 1;
if (g_task_ctx.progress_enabled) {
g_task_ctx.tp = TASK_NOTHING;