Skip to content

Commit

Permalink
Avoid using $_ when loading the commands from namespaces
Browse files Browse the repository at this point in the history
resolves #2175
  • Loading branch information
bbrtj committed Sep 10, 2024
1 parent ecb44cf commit 32871e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Mojolicious/Commands.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ sub run {
# Find all available commands
my %all;
for my $ns (@{$self->namespaces}) {
$all{substr $_, length "${ns}::"} //= $_->new->description
for grep { _command($_) } find_modules($ns), find_packages($ns);
for my $pkg (find_modules($ns), find_packages($ns)) {
next unless _command($pkg);
$all{substr $pkg, length "${ns}::"} //= $pkg->new->description;
}
}

my @rows;
Expand Down

0 comments on commit 32871e0

Please sign in to comment.