mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-30 17:31:43 +00:00
btrfs-progs: prop: don't print full usage on invalid arguments
Let the specific error be the last message printed and don't dump the whole usage that's not quite helpful in this context. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2d4b083b7c
commit
5a803bfd27
@ -306,7 +306,7 @@ static int parse_args(int argc, char **argv,
|
||||
*types = prop_object_dev;
|
||||
} else {
|
||||
error("invalid object type: %s", type_str);
|
||||
usage(usage_str);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,11 +321,11 @@ static int parse_args(int argc, char **argv,
|
||||
if (ret < 0) {
|
||||
errno = -ret;
|
||||
error("failed to detect object type: %m");
|
||||
usage(usage_str);
|
||||
return 1;
|
||||
}
|
||||
if (!*types) {
|
||||
error("object is not a btrfs object: %s", *object);
|
||||
usage(usage_str);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user