| 1 | package CLI::Framework::Command::Help; | ||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use base qw( CLI::Framework::Command::Meta ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | 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 | help [command name]: usage information for an individual command or the application itself | ||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | sub run { | ||||||||||||||||||||||||||||
| 18 | 2 | ▶ | my ($self, $opts, @args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
run: called CC=7 SCAR=25.2
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | my $app = $self->get_app(); # metacommand is app-aware | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 2 | my $usage; | |||||||||||||||||||||||||||
| 23 | 2 | my $command_name = shift @args; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | # Recognize help requests that refer to the target command by an alias... | ||||||||||||||||||||||||||||
| 26 | 2 | my %alias = $app->command_alias(); | |||||||||||||||||||||||||||
| 27 | 2 | ▶ | $command_name = $alias{$command_name} if $command_name && exists $alias{$command_name}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$command_name and exists $alias{$command_name}
MC/DC0%0/2
$command_name and exists $alias{$command_name}
$command_name
exists $alias{$command_name}
Truth table33%1/3
A and B
A= $command_nameB= exists $alias{$command_name}
| |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | # First, attempt to get command-specific usage message... | ||||||||||||||||||||||||||||
| 30 | 2 | ▶ | if( $command_name ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | # (do not show command-specific usage message for non-interactive | ||||||||||||||||||||||||||||
| 32 | # commands when in interactive mode) | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | $usage = $app->usage( $command_name, @args ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$app->get_interactivity_mode and not $app->is_interactive_command($command_name)
MC/DC0%0/2
$app->get_interactivity_mode and not $app->is_interactive_command($command_name)
$app->get_interactivity_mode
not $app->is_interactive_command($command_name)
Truth table0%0/3
A and not(B)
A= $app->get_interactivity_modeB= not $app->is_interactive_command($command_name)
| |||||||||||||||||||||||||||||
| 34 | unless( $app->get_interactivity_mode() && ! $app->is_interactive_command($command_name) ); | ||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | # Fall back to application usage message... | ||||||||||||||||||||||||||||
| 37 | 2 | ▶ | $usage ||= $app->usage(); | ||||||||||||||||||||||||||
|
Condition33%1/3
$usage ||= $app->usage
MC/DC0%0/2
$usage ||= $app->usage
$usage
$app->usage
Truth table33%1/3
A ||= B
A= $usageB= $app->usage
| |||||||||||||||||||||||||||||
| 38 | 2 | return $usage; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | #------- | ||||||||||||||||||||||||||||
| 42 | 3 | 1; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||