| 1 | package Analizo::Command::help; | ||||||||||||||||||||||||||||||||||
| 2 | 9 | ▶ | use parent qw(App::Cmd::Command::help Analizo::Command); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||
| 6 | #ABSTRACT: displays the help | ||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||
| 10 | analizo-help - displays the help | ||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||
| 14 | This module inherits from the L<App::Cmd::Command::help> just to provide a way | ||||||||||||||||||||||||||||||||||
| 15 | to displays the version, help and usage of the `analizo` script. For example: | ||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | analizo --version | ||||||||||||||||||||||||||||||||||
| 18 | analizo --help | ||||||||||||||||||||||||||||||||||
| 19 | analizo --usage | ||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||
| 21 | As documented in L<App::Cmd#default_command> the `help` is the default command, | ||||||||||||||||||||||||||||||||||
| 22 | it is called when the script `analizo` is executed without inform any command. | ||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||
| 24 | analizo help is part of the analizo suite. | ||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||
| 26 | =cut | ||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub execute { | ||||||||||||||||||||||||||||||||
|
Subroutine
execute: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 29 | 0 | my ($self, $opt, $args) = @_; | |||||||||||||||||||||||||||||||||
| 30 | 0 | my $command_name = $args->[0]; | |||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | if ($self->app->global_options->version) { | ||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||
| 32 | 0 | printf("%s\n", $self->version_information); | |||||||||||||||||||||||||||||||||
| 33 | 0 | exit 0; | |||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||
| 35 | elsif ($command_name) { | ||||||||||||||||||||||||||||||||||
| 36 | 0 | (my $package_name = $command_name) =~ s/-/_/g; | |||||||||||||||||||||||||||||||||
| 37 | 0 | $self->show_manpage("Analizo::Command::$package_name", $command_name); | |||||||||||||||||||||||||||||||||
| 38 | 0 | exit 0; | |||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||
| 40 | ▶ | elsif ($self->app->global_options->help || (@ARGV && $ARGV[0] eq '--help')) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/6
$self->app->global_options->help or @ARGV and $ARGV[0] eq "--help"
@ARGV and $ARGV[0] eq "--help"
MC/DC0%0/3
$self->app->global_options->help or @ARGV and $ARGV[0] eq "--help"
$self->app->global_options->help
@ARGV
$ARGV[0] eq "--help"
Truth table0%0/4
A or B and C
A= $self->app->global_options->helpB= @ARGVC= $ARGV[0] eq "--help"
| |||||||||||||||||||||||||||||||||||
| 41 | 0 | $self->show_manpage('Analizo', 'analizo'); | |||||||||||||||||||||||||||||||||
| 42 | 0 | exit 0; | |||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||
| 44 | elsif ($self->app->global_options->usage) { | ||||||||||||||||||||||||||||||||||
| 45 | 0 | print $self->app->usage; | |||||||||||||||||||||||||||||||||
| 46 | 0 | exit 0; | |||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||
| 48 | 0 | $self->SUPER::execute($opt, $args); | |||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||
| 51 | 9 | 1; | |||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||
| 53 | =head1 COPYRIGHT AND AUTHORS | ||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||
| 55 | See B<analizo(1)>. | ||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||||||||||||||||