Debian Codegraph @

lib/Analizo/Command/help.pm

raw
1 package Analizo::Command::help;
2 use parent qw(App::Cmd::Command::help Analizo::Command);
3 use strict;
4 use warnings;
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 sub execute {
29 my ($self, $opt, $args) = @_;
30 my $command_name = $args->[0];
31 if ($self->app->global_options->version) {
32 printf("%s\n", $self->version_information);
33 exit 0;
34 }
35 elsif ($command_name) {
36 (my $package_name = $command_name) =~ s/-/_/g;
37 $self->show_manpage("Analizo::Command::$package_name", $command_name);
38 exit 0;
39 }
40 elsif ($self->app->global_options->help || (@ARGV && $ARGV[0] eq '--help')) {
41 $self->show_manpage('Analizo', 'analizo');
42 exit 0;
43 }
44 elsif ($self->app->global_options->usage) {
45 print $self->app->usage;
46 exit 0;
47 }
48 $self->SUPER::execute($opt, $args);
49 }
50
51 1;
52
53 =head1 COPYRIGHT AND AUTHORS
54
55 See B<analizo(1)>.
56
57 =cut