]> sourceware.org Git - lvm2.git/commitdiff
Prevent cmdline flags that take args getting repeated.
authorAlasdair Kergon <agk@redhat.com>
Mon, 15 Sep 2003 15:02:24 +0000 (15:02 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 15 Sep 2003 15:02:24 +0000 (15:02 +0000)
tools/lvm.c

index 0b5cb5696382f71a7b7d88865a715f7a5c6fe5d1..474fb9beaf69bf8171e8179a497f6ff15af0e201 100644 (file)
@@ -485,6 +485,15 @@ static int _process_command_line(struct cmd_context *cmd, int *argc,
                }
 
                if (a->fn) {
+                       if (a->count) {
+                               log_error("Option%s%c%s%s may not be repeated",
+                                         a->short_arg ? " -" : "",
+                                         a->short_arg ? : ' ',
+                                         (a->short_arg && a->long_arg) ? 
+                                               "/" : "",
+                                         a->long_arg ? : "");
+                                       return 0;
+                       }
 
                        if (!optarg) {
                                log_error("Option requires argument.");
This page took 0.032181 seconds and 5 git commands to generate.