mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-04 11:51:42 +00:00
btrfs-progs: better option/error handling for btrfs-vol
Today wrong cmdlines give odd results: # ./btrfs-vol /dev/sdb1 Unable to open device (null) # ./btrfs-vol -a /dev/sdb1 usage: btrfs-vol [options] mount_point ... Make it a bit more informative: # ./btrfs-vol /dev/sdb1 No command specified usage: btrfs-vol [options] mount_point ... # ./btrfs-vol -a /dev/sdb1 No mountpoint specified usage: btrfs-vol [options] mount_point ... (even though it's deprecated ...) Signed-off-by: Eric Sandeen <sandeen@redhat.com>
This commit is contained in:
parent
7b81119b1d
commit
6626354fdf
@ -106,8 +106,13 @@ int main(int ac, char **av)
|
||||
}
|
||||
}
|
||||
ac = ac - optind;
|
||||
if (ac == 0)
|
||||
if (ac == 0 || !cmd) {
|
||||
if (!ac)
|
||||
fprintf(stderr, "No mountpoint specified\n");
|
||||
else
|
||||
fprintf(stderr, "No command specified\n");
|
||||
print_usage();
|
||||
}
|
||||
mnt = av[optind];
|
||||
|
||||
if (device && strcmp(device, "missing") == 0 &&
|
||||
|
Loading…
Reference in New Issue
Block a user