This commit is contained in:
garnier-quentin 2015-12-08 15:35:30 +01:00
parent c8513a2522
commit ae5b309103

View File

@ -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++;
} }
} }