From babe94e4817aca45aef409b7a21bc47e51cda6ff Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 1 Mar 2016 16:02:08 +0100 Subject: 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 --- cmds-property.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmds-property.c') 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); -- cgit v1.2.3