| 1 | # ABSTRACT: display a command's help screen | ||||||||||
| 2 | |||||||||||
| 3 | package App::Pinto::Command::help; | ||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use base qw(App::Cmd::Command::help); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | #------------------------------------------------------------------------------- | ||||||||||
| 11 | |||||||||||
| 12 | 1 | our $VERSION = '0.14'; # VERSION | |||||||||
| 13 | |||||||||||
| 14 | #------------------------------------------------------------------------------- | ||||||||||
| 15 | # This is just a thin subclass of App::Cmd::Command::help. All we have done is | ||||||||||
| 16 | # extend the exeucte() method to mention the "pinto manual" command at the end | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 19 | 0 | my ( $self, $opts, $args ) = @_; | |||||||||
| 20 | |||||||||||
| 21 | 0 | my ( $cmd, undef, undef ) = $self->app->prepare_command(@$args); | |||||||||
| 22 | 0 | my ($cmd_name) = $cmd->command_names; | |||||||||
| 23 | |||||||||||
| 24 | 0 | my $rv = $self->SUPER::execute( $opts, $args ); | |||||||||
| 25 | |||||||||||
| 26 | # Only display this if showing help for a specific command. | ||||||||||
| 27 | 0 | ▶ | print qq{For more information, run "pinto manual $cmd_name"\n} if @{$args}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | |||||||||||
| 29 | 0 | return $rv; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | #------------------------------------------------------------------------------- | ||||||||||
| 33 | 1 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||