/*
* returns 0 if the key did not match (nothing was read)
* 1 if the key did match (success)
- * -1 if the key did match and an error occured
+ * -1 if the key did match and an error occurred
*/
static int scrub_kvread(int *i, int len, int avail, const char *buf,
const char *key, u64 *dest)
int force = 0;
int nothing_to_resume = 0;
- optind = 1;
while ((c = getopt(argc, argv, "BdqrRc:n:f")) != -1) {
switch (c) {
case 'B':
int fdmnt = -1;
DIR *dirstream = NULL;
- if (check_argc_exact(argc, 2))
+ clean_args_no_options(argc, argv, cmd_scrub_cancel_usage);
+
+ if (check_argc_exact(argc - optind, 1))
usage(cmd_scrub_cancel_usage);
- path = argv[1];
+ path = argv[optind];
fdmnt = open_path_or_dev_mnt(path, &dirstream, 1);
if (fdmnt < 0) {
int err = 0;
DIR *dirstream = NULL;
- optind = 1;
while ((c = getopt(argc, argv, "dR")) != -1) {
switch (c) {
case 'd':