blib/lib/App/Pinto/Command/roots.pm

filter: Statementstmt 60.8% 14 / 23 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 100% 3 / 3 totaltotal 53.8% 21 / 39 CC 4 SCAR 21.7
CC
4
Cov
48%
validate_args
20.0
command_names
2.0
opt_spec
2.0
CRAP 8.8
« blib/lib/Pinto/Remote/Action/Install.pm ↑ Summary blib/lib/Pinto/Action/Reset.pm »
1 package App::Pinto::Command::roots;
2  
3 # ABSTRACT: show the roots of a stack
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 Pinto::Util qw(interpolate);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 #-----------------------------------------------------------------------------
11  
12 1 ▶use base 'App::Pinto::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 #------------------------------------------------------------------------------
15  
16 1 our $VERSION = '0.14'; # VERSION
17  
18 #------------------------------------------------------------------------------
19  
20 0 ▶sub command_names { return qw( roots ) }
Subroutine command_names: not called CC=1 SCAR=6.9
Pod documented
21  
22 #------------------------------------------------------------------------------
23  
24 0 ▶sub opt_spec {
Subroutine opt_spec: not called CC=1 SCAR=6.9
Pod documented
25 0 my ( $self, $app ) = @_;
26  
27 return (
28 0 [ 'format=s' => 'Format specification (See POD for details)' ],
29 [ 'stack|s=s' => 'Show roots of this stack' ],
30 );
31 }
32  
33 #------------------------------------------------------------------------------
34  
35 0 ▶sub validate_args {
Subroutine validate_args: not called CC=4 SCAR=30.0
Pod documented
36 0 my ( $self, $opts, $args ) = @_;
37  
38 $self->usage_error('Multiple arguments are not allowed')
39 0 ▶ if @{$args} > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} > 1 0 0 0
40  
41 $opts->{format} = interpolate( $opts->{format} )
42 0 ▶ if exists $opts->{format};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"format"} 0 0 0
43  
44 0 ▶ $opts->{stack} = $args->[0]
Branch: 1 branch
BranchTrueFalseTotal
if $args->[0] 0 0 0
45 if $args->[0];
46  
47 0 return 1;
48 }
49  
50 #------------------------------------------------------------------------------
51  
52 1 1;
53  
54 __END__
« blib/lib/Pinto/Remote/Action/Install.pm ↑ Summary blib/lib/Pinto/Action/Reset.pm »