mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-15 03:36:21 +00:00
fix getopt when invoking without arguments
This commit is contained in:
parent
893ec6f259
commit
ff2bf45fab
@ -1406,6 +1406,16 @@ sub get_options {
|
|||||||
raise("too many arguments\n", code => HTTP_BAD_REQUEST)
|
raise("too many arguments\n", code => HTTP_BAD_REQUEST)
|
||||||
if scalar(@$args) != 0;
|
if scalar(@$args) != 0;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (ref($arg_param)) {
|
||||||
|
foreach my $arg_name (@$arg_param) {
|
||||||
|
if ($arg_name eq 'extra-args') {
|
||||||
|
$opts->{'extra-args'} = [];
|
||||||
|
} else {
|
||||||
|
raise("not enough arguments\n", code => HTTP_BAD_REQUEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (my $pd = $schema->{properties}->{password}) {
|
if (my $pd = $schema->{properties}->{password}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user