blib/lib/CLI/Framework/Command/List.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 28 CC 2 SCAR 12.0
CC
2
Cov
0%
run
6.0
usage_text
2.0
BEGIN
2.0
CRAP 3.3
1 package CLI::Framework::Command::List;
2 use base qw( CLI::Framework::Command::Meta );
3  
4 use strict;
5 use warnings;
6  
7 our $VERSION = 0.01;
8  
9 #-------
10  
11 sub usage_text {
12 q{
13 list: print a concise list of the names of all commands available to the application
14 }
15 }
16  
17 sub run {
18 my ($self, $opts, @args) = @_;
19  
20 my $app = $self->get_app(); # metacommand is app-aware
21  
22 # If interactive, exclude commands that do not apply in interactive mode...
23 my @command_set = $app->get_interactivity_mode()
24 ? $app->get_interactive_commands()
25 : keys %{ $app->command_map_hashref() };
26  
27 my $result = join(', ', map { lc $_ } @command_set ) . "\n";
28 return $result;
29 }
30  
31 #-------
32 1;
33  
34 __END__