diff options
author | David Sterba <dsterba@suse.com> | 2016-03-01 16:02:08 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-03-14 13:42:47 +0100 |
commit | babe94e4817aca45aef409b7a21bc47e51cda6ff (patch) | |
tree | a00641b956754d6bd002bb23c6b8e3d3a18b8740 /cmds-property.c | |
parent | c27640938de1506e0a02f7f928a00886d5da616a (diff) |
btrfs-progs: add getopt stubs where needed
Commands that do not take any options do not use getopt, which means the
standard option separator "--" does not work. Update all command
handlers that need it, argv needs to be referenced using the optind that
is correctly pointed after the separator.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-property.c')
-rw-r--r-- | cmds-property.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmds-property.c b/cmds-property.c index b7b24841..5b4da26a 100644 --- a/cmds-property.c +++ b/cmds-property.c @@ -379,6 +379,8 @@ static int cmd_property_get(int argc, char **argv) char *name = NULL; int types = 0; + clean_args_no_options(argc, argv, cmd_property_get_usage); + if (check_argc_min(argc, 2) || check_argc_max(argc, 5)) usage(cmd_property_get_usage); @@ -413,6 +415,8 @@ static int cmd_property_set(int argc, char **argv) char *value = NULL; int types = 0; + clean_args_no_options(argc, argv, cmd_property_set_usage); + if (check_argc_min(argc, 4) || check_argc_max(argc, 6)) usage(cmd_property_set_usage); @@ -442,6 +446,8 @@ static int cmd_property_list(int argc, char **argv) char *object = NULL; int types = 0; + clean_args_no_options(argc, argv, cmd_property_list_usage); + if (check_argc_min(argc, 2) || check_argc_max(argc, 4)) usage(cmd_property_list_usage); |