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

filter: Statementstmt 45.8% 11 / 24 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 37.7% 17 / 45 CC 5 SCAR 22.7
CC
5
Cov
32%
validate_args
20.0
execute
6.0
opt_spec
2.0
CRAP 9.7
« blib/lib/Pinto/Editor.pm ↑ Summary blib/lib/App/Pinto/Command/reset.pm »
1 # ABSTRACT: mark the default stack
2  
3 package App::Pinto::Command::default;
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 #-----------------------------------------------------------------------------
9  
10 1 ▶use base 'App::Pinto::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 #------------------------------------------------------------------------------
13  
14 1 our $VERSION = '0.14'; # VERSION
15  
16 #------------------------------------------------------------------------------
17  
18 0 ▶sub opt_spec {
Subroutine opt_spec: not called CC=1 SCAR=6.9
Pod documented
19 0 my ( $self, $app ) = @_;
20  
21 0 return ( [ 'none' => 'Unmark the default stack' ] );
22 }
23  
24 #-----------------------------------------------------------------------------
25  
26 0 ▶sub validate_args {
Subroutine validate_args: not called CC=4 SCAR=30.0
Pod documented
27 0 my ( $self, $opts, $args ) = @_;
28  
29 $self->usage_error('Cannot specify multiple stacks')
30 0 ▶ if @{$args} > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} > 1 0 0 0
31  
32 $self->usage_error('Must specify a STACK or --none')
33 0 ▶ if !( @{$args} xor $opts->{none} );
Branch: 1 branch
BranchTrueFalseTotal
unless @{$args;} xor $opts->{"none"} 0 0 0
Condition0%0/4
@{$args;} xor $opts->{"none"}
l&&rl&&!r!l&&r!l&&!r
0000
MC/DC0%0/2
@{$args;} xor $opts->{"none"}
@{$args;} $opts->{"none"}
Truth table0%0/4
A xor B
A= @{$args;}B= $opts->{"none"}
ABresult
110
101
011
000
34  
35 0 return 1;
36 }
37  
38 #------------------------------------------------------------------------------
39  
40 0 ▶sub execute {
Subroutine execute: not called CC=2 SCAR=17.9
Pod documented
41 0 my ( $self, $opts, $args ) = @_;
42  
43 0 ▶ $opts->{stack} = $args->[0] if $args->[0];
Branch: 1 branch
BranchTrueFalseTotal
if $args->[0] 0 0 0
44  
45 0 my $result = $self->pinto->run( $self->action_name, %{$opts} );
46  
47 0 return $result->exit_status;
48 }
49  
50 #------------------------------------------------------------------------------
51 1 1;
52  
53 __END__
« blib/lib/Pinto/Editor.pm ↑ Summary blib/lib/App/Pinto/Command/reset.pm »