mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-08 00:00:12 +03:00
c_src: Ensure all commands support -h and --help
This commit is contained in:
parent
7873eb976e
commit
30fcb00f69
@ -128,7 +128,7 @@ static void setattr_usage(void)
|
||||
bch2_opts_usage(OPT_INODE);
|
||||
puts(" --remove-all Remove all file options\n"
|
||||
" To remove specific options, use: --option=-\n"
|
||||
" -h Display this help and exit\n"
|
||||
" -h, --help Display this help and exit\n"
|
||||
"\n"
|
||||
"Report bugs to <linux-bcachefs@vger.kernel.org>");
|
||||
}
|
||||
@ -139,6 +139,14 @@ int cmd_setattr(int argc, char *argv[])
|
||||
bool remove_all = false;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "--help") == 0) {
|
||||
setattr_usage();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
if (strcmp(argv[i], "-h") == 0) {
|
||||
setattr_usage();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
if (strcmp(argv[i], "--remove-all") == 0) {
|
||||
remove_all = true;
|
||||
bch_remove_arg_from_argv(&argc, argv, i);
|
||||
|
||||
@ -259,6 +259,7 @@ static int cmd_device_offline(int argc, char *argv[])
|
||||
{
|
||||
static const struct option longopts[] = {
|
||||
{ "force", 0, NULL, 'f' },
|
||||
{ "help", 0, NULL, 'h' },
|
||||
{ NULL }
|
||||
};
|
||||
int opt, flags = 0;
|
||||
|
||||
@ -192,7 +192,7 @@ static void migrate_usage(void)
|
||||
" --encrypted Enable whole filesystem encryption (chacha20/poly1305)\n"
|
||||
" --no_passphrase Don't encrypt master encryption key\n"
|
||||
" -F Force, even if metadata file already exists\n"
|
||||
" -h Display this help and exit\n"
|
||||
" -h, --help Display this help and exit\n"
|
||||
"\n"
|
||||
"Report bugs to <linux-bcachefs@vger.kernel.org>");
|
||||
}
|
||||
@ -200,6 +200,7 @@ static void migrate_usage(void)
|
||||
static const struct option migrate_opts[] = {
|
||||
{ "encrypted", no_argument, NULL, 'e' },
|
||||
{ "no_passphrase", no_argument, NULL, 'p' },
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user