| 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
| |||||||||||
| 26 | |||||||||||
| 27 | 0 | my $result = join(', ', map { lc $_ } @command_set ) . "\n"; | |||||||||
| 28 | 0 | return $result; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | #------- | ||||||||||
| 32 | 1 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||