mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Prevent cmdline flags that take args getting repeated.
This commit is contained in:
parent
57c74fb5af
commit
fe22eb84e6
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user