diff --git a/c_src/cmd_attr.c b/c_src/cmd_attr.c index 5490d234..ddbb91a9 100644 --- a/c_src/cmd_attr.c +++ b/c_src/cmd_attr.c @@ -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 "); } @@ -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); diff --git a/c_src/cmd_device.c b/c_src/cmd_device.c index 2adad71e..cabdf70c 100644 --- a/c_src/cmd_device.c +++ b/c_src/cmd_device.c @@ -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; diff --git a/c_src/cmd_migrate.c b/c_src/cmd_migrate.c index 652c5f75..2c52bf5c 100644 --- a/c_src/cmd_migrate.c +++ b/c_src/cmd_migrate.c @@ -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 "); } @@ -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 } };