JESP/Cmd.pm

filter: Statementstmt 68.9% 20 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 2 / 2 totaltotal 66.6% 28 / 42 CC 2 SCAR 7.9
CC
2
Cov
65%
execute_command
6.0
global_opt_spec
2.0
__ANON__
2.0
CRAP 2.2
« JESP/Cmd/Command/about.pm ↑ Summary JESP/Plan.pm »
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
BranchTrueFalseTotal
if ($self->global_options->{'verbose'}) { } 0 0 0
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;
« JESP/Cmd/Command/about.pm ↑ Summary JESP/Plan.pm »