sbin/hammer2: Add missing usage() exit for "destroy"/"destroy-inum"
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 18 Aug 2019 15:44:23 +0000 (00:44 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 18 Aug 2019 15:46:38 +0000 (00:46 +0900)
sbin/hammer2/main.c

index 4c81828..c9599fe 100644 (file)
@@ -205,14 +205,17 @@ main(int ac, char **av)
                if (ac < 2) {
                        fprintf(stderr,
                                "Specify one or more paths to destroy\n");
+                       usage(1);
                }
                ecode = cmd_destroy_path(ac - 1, (const char **)(void *)&av[1]);
        } else if (strcmp(av[0], "destroy-inum") == 0) {
                if (ac < 2) {
                        fprintf(stderr,
                                "Specify one or more inode numbers to destroy\n");
+                       usage(1);
                }
-               ecode = cmd_destroy_inum(sel_path, ac - 1, (const char **)(void *)&av[1]);
+               ecode = cmd_destroy_inum(sel_path, ac - 1,
+                                        (const char **)(void *)&av[1]);
        } else if (strcmp(av[0], "hash") == 0) {
                ecode = cmd_hash(ac - 1, (const char **)(void *)&av[1]);
        } else if (strcmp(av[0], "dhash") == 0) {