mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-16 21:40:46 +01:00
Interpreter: minor comments about getopt
This commit is contained in:
parent
2d0361e7f6
commit
a0e2ba3610
@ -1388,7 +1388,7 @@ sub getopt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# getopt_from_string() uses our split_line() function instead of
|
# 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 {
|
sub getopt_from_string {
|
||||||
my ($self, $string, $result, $config, @opts) = @_;
|
my ($self, $string, $result, $config, @opts) = @_;
|
||||||
|
|
||||||
@ -1397,9 +1397,11 @@ sub getopt_from_string {
|
|||||||
return $self->getopt_from_array(\@opt_args, $result, $config, @opts);
|
return $self->getopt_from_array(\@opt_args, $result, $config, @opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# the workhorse getopt function
|
||||||
sub getopt_from_array {
|
sub getopt_from_array {
|
||||||
my ($self, $opt_args, $result, $config, @opts) = @_;
|
my ($self, $opt_args, $result, $config, @opts) = @_;
|
||||||
|
|
||||||
|
# emitting errors as Perl warnings instead of using die, weird.
|
||||||
my $opt_error;
|
my $opt_error;
|
||||||
local $SIG{__WARN__} = sub {
|
local $SIG{__WARN__} = sub {
|
||||||
$opt_error = shift;
|
$opt_error = shift;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user