summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2018-07-13 13:12:08 +0100
committerdakkar <dakkar@thenautilus.net>2018-07-13 13:12:08 +0100
commita841f2370e11350c34500ff33e77b8f116120e14 (patch)
treeb4b0e7c45ca69a71d5f526ca23622c8fce4cd4b7
parentpieces have names (diff)
downloadGetopt-Dakkar-a841f2370e11350c34500ff33e77b8f116120e14.tar.gz
Getopt-Dakkar-a841f2370e11350c34500ff33e77b8f116120e14.tar.bz2
Getopt-Dakkar-a841f2370e11350c34500ff33e77b8f116120e14.zip
make sure we return undef when stuff is not found
-rw-r--r--lib/Getopt/Dakkar/Role/Command.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Getopt/Dakkar/Role/Command.pm b/lib/Getopt/Dakkar/Role/Command.pm
index b96c410..8fa491b 100644
--- a/lib/Getopt/Dakkar/Role/Command.pm
+++ b/lib/Getopt/Dakkar/Role/Command.pm
@@ -68,9 +68,11 @@ sub _match_option($self,$arg) {
for my $option ($self->options->@*) {
return $option if $option->match($arg);
}
+ return undef;
}
sub _match_subcommand($self,$arg) {
for my $subcommand ($self->subcommands->@*) {
return $subcommand if $subcommand->match($arg);
}
+ return undef;
}