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>
master
David Sterba 2019-03-04 15:05:54 +01:00
parent 2d4b083b7c
commit 5a803bfd27
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}