| 1 | package CohortExplorer::Command::Help; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | our $VERSION = 0.14; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use base qw( CLI::Framework::Command::Meta ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | #------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub usage_text { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
usage_text: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | q{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | help [command]: application or command specific usage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub run { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: not called CC=12 SCAR=50.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my ( $self, $opts, @args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # Metacommand is app-aware | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $app = $self->get_app; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my $usage; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | my $command_name = shift @args; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # Recognise help requests that refer to the target command by an alias | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my %alias = $app->command_alias; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | $command_name = $alias{$command_name} if $command_name && exists $alias{$command_name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/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 table0%0/3
A and B
A= $command_nameB= exists $alias{$command_name}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my $h = $app->command_map_hashref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | # First, attempt to get command-specific usage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | if ($command_name) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | # (do not show command-specific usage message for non-interactive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | # commands when in interactive mode) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 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)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | unless ( $app->get_interactivity_mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | && !$app->is_interactive_command($command_name) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my $app_usage = $app->usage; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # Remove usage of invalid/noninteractive commands from application help | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | for ( $app->noninteractive_commands ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$_ =~ /^(?:search|compare|history)$/ and not $app->is_interactive_command($_) or $_ =~ /^(?:menu|console)$/ and $app->get_interactivity_mode
$_ =~ /^(?:search|compare|history)$/ and not $app->is_interactive_command($_)
$_ =~ /^(?:menu|console)$/ and $app->get_interactivity_mode
MC/DC0%0/4
$_ =~ /^(?:search|compare|history)$/ and not $app->is_interactive_command($_) or $_ =~ /^(?:menu|console)$/ and $app->get_interactivity_mode
$_ =~ /^(?:search|compare|history)$/
not $app->is_interactive_command($_)
$_ =~ /^(?:menu|console)$/
$app->get_interactivity_mode
Truth table0%0/7
A and not(B) or C and D
A= $_ =~ /^(?:search|compare|history)$/B= not $app->is_interactive_command($_)C= $_ =~ /^(?:menu|console)$/D= $app->get_interactivity_mode
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | $_ =~ /^(?:search|compare|history)$/ && !$app->is_interactive_command($_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | || ( $_ =~ /^(?:menu|console)$/ && $app->get_interactivity_mode ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | $app_usage =~ s/\n\s+$_\s+\-[^\n]+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | # Fall back to application usage message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | $usage ||= $app_usage; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$usage ||= $app_usage
MC/DC0%0/2
$usage ||= $app_usage
$usage
$app_usage
Truth table0%0/3
A ||= B
A= $usageB= $app_usage
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | return $usage; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | #------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||