mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
+ Fix #237
This commit is contained in:
parent
c8513a2522
commit
ae5b309103
@ -58,7 +58,7 @@ sub GetOptions {
|
|||||||
my $search_str = ',' . join(',', keys %opts) . ',';
|
my $search_str = ',' . join(',', keys %opts) . ',';
|
||||||
my $num_args = scalar(@ARGV);
|
my $num_args = scalar(@ARGV);
|
||||||
for (my $i = 0; $i < $num_args;) {
|
for (my $i = 0; $i < $num_args;) {
|
||||||
if ($ARGV[$i] =~ /^--(.*?)(?:=|$)(.*)/) {
|
if (defined($ARGV[$i]) && $ARGV[$i] =~ /^--(.*?)(?:=|$)(.*)/) {
|
||||||
my ($option, $value) = ($1, $2);
|
my ($option, $value) = ($1, $2);
|
||||||
|
|
||||||
# find type of option
|
# find type of option
|
||||||
@ -89,7 +89,7 @@ sub GetOptions {
|
|||||||
splice @ARGV, $i, 1;
|
splice @ARGV, $i, 1;
|
||||||
$num_args--;
|
$num_args--;
|
||||||
} else {
|
} else {
|
||||||
warn "argument $ARGV[$i] alone" if ($warn_message == 1 && $i != 0);
|
warn "argument $ARGV[$i] alone" if ($warn_message == 1 && $i != 0 && defined($ARGV[$i]));
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user