optional => 1,
description => "This indicates the default for the instance property."
},
+ completion => {
+ type => 'coderef',
+ description => "Bash completion function. This function should return a list of possible values.",
+ optional => 1,
+ },
disallow => {
type => "object",
optional => 1,
}
}
+ Getopt::Long::Configure('prefix_pattern=(--|-)');
+
my $opts = {};
raise("unable to parse option\n", code => HTTP_BAD_REQUEST)
if !Getopt::Long::GetOptionsFromArray($args, $opts, @getopt);
if ($pd->{format} =~ m/-list/) {
# allow --vmid 100 --vmid 101 and --vmid 100,101
# allow --dow mon --dow fri and --dow mon,fri
- $opts->{$p} = join(",", @{$opts->{$p}});
+ $opts->{$p} = join(",", @{$opts->{$p}}) if ref($opts->{$p}) eq 'ARRAY';
} elsif ($pd->{format} =~ m/-alist/) {
# we encode array as \0 separated strings
# Note: CGI.pm also use this encoding