line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Framework::Command::List; |
2
|
1
|
|
|
1
|
|
1955
|
use base qw( CLI::Framework::Command::Meta ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
73
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
246
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.01; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#------- |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub usage_text { |
12
|
0
|
|
|
0
|
1
|
|
q{ |
13
|
|
|
|
|
|
|
list: print a concise list of the names of all commands available to the application |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub run { |
18
|
0
|
|
|
0
|
1
|
|
my ($self, $opts, @args) = @_; |
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
|
0
|
|
|
|
|
|
my @command_set = $app->get_interactivity_mode() |
24
|
|
|
|
|
|
|
? $app->get_interactive_commands() |
25
|
0
|
0
|
|
|
|
|
: keys %{ $app->command_map_hashref() }; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my $result = join(', ', map { lc $_ } @command_set ) . "\n"; |
|
0
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
return $result; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#------- |
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |