From a841f2370e11350c34500ff33e77b8f116120e14 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Jul 2018 13:12:08 +0100 Subject: make sure we return undef when stuff is not found --- lib/Getopt/Dakkar/Role/Command.pm | 2 ++ 1 file changed, 2 insertions(+) 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; } -- cgit v1.2.3