3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-05 19:49:32 +01:00

Interpreter: minor comments about getopt

This commit is contained in:
Pragmatic Software 2021-08-02 04:57:52 -07:00
parent 2d0361e7f6
commit a0e2ba3610

View File

@ -1388,7 +1388,7 @@ sub getopt {
}
# getopt_from_string() uses our split_line() function instead of
# GetOpt::Long::GetOptionsFromString's Text::ParseWords
# Getopt::Long::GetOptionsFromString's Text::ParseWords
sub getopt_from_string {
my ($self, $string, $result, $config, @opts) = @_;
@ -1397,9 +1397,11 @@ sub getopt_from_string {
return $self->getopt_from_array(\@opt_args, $result, $config, @opts);
}
# the workhorse getopt function
sub getopt_from_array {
my ($self, $opt_args, $result, $config, @opts) = @_;
# emitting errors as Perl warnings instead of using die, weird.
my $opt_error;
local $SIG{__WARN__} = sub {
$opt_error = shift;