summaryrefslogtreecommitdiff
path: root/cmd_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd_debug.c')
-rw-r--r--cmd_debug.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/cmd_debug.c b/cmd_debug.c
index 6e395bab..b622cd39 100644
--- a/cmd_debug.c
+++ b/cmd_debug.c
@@ -103,16 +103,17 @@ int cmd_dump(int argc, char *argv[])
dump_usage();
exit(EXIT_SUCCESS);
}
-
- if (optind >= argc)
- die("Please supply device(s) to check");
+ args_shift(optind);
if (!out)
die("Please supply output filename");
- struct bch_fs *c = bch2_fs_open(argv + optind, argc - optind, opts);
+ if (!argc)
+ die("Please supply device(s) to check");
+
+ struct bch_fs *c = bch2_fs_open(argv, argc, opts);
if (IS_ERR(c))
- die("error opening %s: %s", argv[optind], strerror(-PTR_ERR(c)));
+ die("error opening %s: %s", argv[0], strerror(-PTR_ERR(c)));
down_read(&c->gc_lock);
@@ -299,13 +300,14 @@ int cmd_list(int argc, char *argv[])
list_keys_usage();
exit(EXIT_SUCCESS);
}
+ args_shift(optind);
- if (optind >= argc)
- die("Please supply device(s) to check");
+ if (!argc)
+ die("Please supply device(s)");
- struct bch_fs *c = bch2_fs_open(argv + optind, argc - optind, opts);
+ struct bch_fs *c = bch2_fs_open(argv, argc, opts);
if (IS_ERR(c))
- die("error opening %s: %s", argv[optind], strerror(-PTR_ERR(c)));
+ die("error opening %s: %s", argv[0], strerror(-PTR_ERR(c)));
switch (mode) {
case 0: