lib/CLI/Framework/Command/List.pm

filter: Statementstmt 57.8% 11 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 57.1% 16 / 28 CC 2 SCAR 10.4
CC
2
Cov
52%
run
6.0
usage_text
2.0
BEGIN
1.0
CRAP 2.8
« blib/lib/CLI/Framework/Command/List.pm ↑ Summary lib/CLI/Framework/Command/Menu.pm »
1 package CLI::Framework::Command::List;
2 1 ▶use base qw( CLI::Framework::Command::Meta );
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = 0.01;
8  
9 #-------
10  
11 sub usage_text {
12 0 ▶ q{
Subroutine usage_text: not called CC=1 SCAR=6.9
Pod documented
13 list: print a concise list of the names of all commands available to the application
14 }
15 }
16  
17 sub run {
18 0 ▶ my ($self, $opts, @args) = @_;
Subroutine run: not called CC=2 SCAR=17.9
Pod documented
19  
20 0 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 0 ▶ : keys %{ $app->command_map_hashref() };
Branch: 1 branch
BranchTrueFalseTotal
$app->get_interactivity_mode ? : 0 0 0
26  
27 0 my $result = join(', ', map { lc $_ } @command_set ) . "\n";
28 0 return $result;
29 }
30  
31 #-------
32 1 1;
33  
34 __END__
« blib/lib/CLI/Framework/Command/List.pm ↑ Summary lib/CLI/Framework/Command/Menu.pm »