From 99fc573b3c84dd590c39f22a285af8fb47eaa1fa Mon Sep 17 00:00:00 2001 From: random Date: Sun, 19 Jan 2025 12:35:41 -0500 Subject: [PATCH] whoops --- staticgen.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/staticgen.pl b/staticgen.pl index d4e0333..da1f71a 100755 --- a/staticgen.pl +++ b/staticgen.pl @@ -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);