Skip to content

Commit

Permalink
Avoid using $_ when loading the commands from namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrtj committed May 17, 2024
1 parent 431cc0a commit 91c03a9
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 91c03a9

Please sign in to comment.