whoops
This commit is contained in:
parent
fa2870c4b3
commit
99fc573b3c
1 changed files with 6 additions and 3 deletions
|
@ -61,21 +61,24 @@ sub HandleArgs
|
|||
|
||||
if (defined $opt->{sopt})
|
||||
{
|
||||
if (grep { $_ eq $opt->{sopt} } @soptlist)
|
||||
if (grep { $_ eq $opt->{sopt} // () } @soptlist)
|
||||
{
|
||||
die "Option -$opt->{sopt} cannot be in a list as it requires an argument!\n"
|
||||
if $opt->{arg} eq "required";
|
||||
|
||||
$opt->{handler}();
|
||||
}
|
||||
elsif (defined $+{sopt} and $+{sopt} // "" eq $opt->{sopt})
|
||||
# will make these look better later
|
||||
elsif (defined $+{sopt} and defined $+{sopt}
|
||||
and $+{sopt} eq $opt->{sopt})
|
||||
{
|
||||
$optarg = $+{optarg} // ();
|
||||
$opt->{handler}($optarg);
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $opt->{lopt} and $+{lopt} // "" eq $opt->{lopt})
|
||||
if (defined $opt->{lopt} and defined $+{lopt}
|
||||
and $+{lopt} eq $opt->{lopt})
|
||||
{
|
||||
$optarg = $+{optarg} // ();
|
||||
$opt->{handler}($optarg);
|
||||
|
|
Loading…
Add table
Reference in a new issue