summaryrefslogtreecommitdiff
path: root/cmd_debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-02-08 15:30:19 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-02-08 15:33:43 -0500
commit7875b82630f6431971175e2f4205bb65c2c43488 (patch)
treef200081697939b7cc4d9f972d0d1e8c894af9640 /cmd_debug.c
parent6976570d670e4053f026d380cfe5397a0a8ed139 (diff)
New data rereplicate command
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: