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

filter: Statementstmt 39.2% 11 / 28 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 100% 4 / 4 totaltotal 40.0% 18 / 45 CC 4 SCAR 17.0
CC
4
Cov
32%
validate_args
12.0
execute
6.0
command_names
2.0
CRAP 5.5
« blib/lib/App/Pinto/Command/statistics.pm ↑ Summary blib/lib/App/Pinto/Command/manual.pm »
1 #ABSTRACT: show difference between two stacks
2  
3 package App::Pinto::Command::diff;
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 command_names { return qw(diff) }
Subroutine command_names: not called CC=1 SCAR=6.9
Pod documented
19  
20 #------------------------------------------------------------------------------
21  
22 0 ▶sub opt_spec {
Subroutine opt_spec: not called CC=1 SCAR=6.9
Pod documented
23 0 my ( $self, $app ) = @_;
24  
25 return (
26 0 [ 'diff-style=s' => 'Diff style (concise|detailed)' ],
27 [ 'format=s' => 'Format specification (see POD for details)' ],
28 );
29 }
30  
31 #------------------------------------------------------------------------------
32 0 ▶sub validate_args {
Subroutine validate_args: not called CC=3 SCAR=24.8
Pod documented
33 0 my ( $self, $opts, $args ) = @_;
34  
35 0 ▶ $self->usage_error('Must specify at least one stack or revision') if @{$args} < 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} < 1 0 0 0
36  
37 0 ▶ $self->usage_error('Cannot specify more than two stacks or revisions') if @{$args} > 2;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} > 2 0 0 0
38  
39 0 return 1;
40 }
41  
42 #------------------------------------------------------------------------------
43  
44 0 ▶sub execute {
Subroutine execute: not called CC=2 SCAR=17.9
Pod documented
45 0 my ( $self, $opts, $args ) = @_;
46  
47 # If there's only one argument, then the left argument
48 # is assumed to be the default stack (i.e. undef)
49 0 ▶ unshift @{$args}, undef if @{$args} == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} == 1 0 0 0
50  
51 0 my %stacks = ( left => $args->[0], right => $args->[1] );
52 0 my $result = $self->pinto->run( $self->action_name, %{$opts}, %stacks );
53  
54 0 return $result->exit_status;
55 }
56  
57 #------------------------------------------------------------------------------
58 1 1;
59  
60 __END__
« blib/lib/App/Pinto/Command/statistics.pm ↑ Summary blib/lib/App/Pinto/Command/manual.pm »