| 1 | package App::JESP::Cmd; | ||||||||||
| 2 | 1 | $App::JESP::Cmd::VERSION = '0.016'; | |||||||||
| 3 | 1 | ▶ | use App::Cmd::Setup -app; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use App::JESP; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use Log::Any::Adapter; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | App::JESP::Cmd - Command line interface. | ||||||||||
| 14 | |||||||||||
| 15 | =cut | ||||||||||
| 16 | |||||||||||
| 17 | =head2 global_opt_spec | ||||||||||
| 18 | |||||||||||
| 19 | Adds verbosity level | ||||||||||
| 20 | |||||||||||
| 21 | See L<App::Cmd> | ||||||||||
| 22 | |||||||||||
| 23 | =cut | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub global_opt_spec { | ||||||||
|
Subroutine
global_opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | 0 | my ($self) = @_; | |||||||||
| 27 | return ( | ||||||||||
| 28 | [ "verbose|v", "log additional output" ], | ||||||||||
| 29 | [ "lib-inc|I=s@", "additional \@INC dirs", { | ||||||||||
| 30 | 0 | ▶ | callbacks => { 'always fine' => sub { unshift @INC, @{$_[0]}; } } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 31 | 0 | } ], | |||||||||
| 32 | $self->SUPER::global_opt_spec, | ||||||||||
| 33 | ); | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | =head2 execute_command | ||||||||||
| 37 | |||||||||||
| 38 | See L<App::Cmd> | ||||||||||
| 39 | |||||||||||
| 40 | =cut | ||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub execute_command { | ||||||||
|
Subroutine
execute_command: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 43 | 0 | my ($self, $cmd, $opts, @args) = @_; | |||||||||
| 44 | 0 | ▶ | if( $self->global_options()->{verbose} ){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 0 | Log::Any::Adapter->set( 'Stdout' , log_level => 'debug' ); | |||||||||
| 46 | }else{ | ||||||||||
| 47 | 0 | Log::Any::Adapter->set( 'Stdout' , log_level => 'info' ); | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 0 | return $self->SUPER::execute_command( $cmd , $opts , @args ); | |||||||||
| 51 | } | ||||||||||
| 52 | 1 | 1; | |||||||||