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

filter: Statementstmt 58.3% 14 / 24 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 100% 3 / 3 totaltotal 44.6% 21 / 47 CC 6 SCAR 30.8
CC
6
Cov
40%
validate_args
42.0
command_names
2.0
opt_spec
2.0
CRAP 21.7
« blib/lib/Pinto/Locator/Stratopan.pm ↑ Summary blib/lib/Pinto/Action/Install.pm »
1 package App::Pinto::Command::list;
2  
3 # ABSTRACT: show the packages in 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( list ls ) }
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 [ 'all|a' => 'List everything in the repository'],
29 [ 'authors|A=s' => 'Limit to matching author identities' ],
30 [ 'distributions|D=s' => 'Limit to matching distribution names' ],
31 [ 'packages|P=s' => 'Limit to matching package names' ],
32 [ 'pinned!' => 'Limit to pinned packages (negatable)' ],
33 [ 'format=s' => 'Format specification (See POD for details)' ],
34 [ 'stack|s=s' => 'List contents of this stack' ],
35 );
36 }
37  
38 #------------------------------------------------------------------------------
39  
40 0 ▶sub validate_args {
Subroutine validate_args: not called CC=6 SCAR=37.4
Pod documented
41 0 my ( $self, $opts, $args ) = @_;
42  
43 $self->usage_error('Multiple arguments are not allowed')
44 0 ▶ if @{$args} > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} > 1 0 0 0
45  
46 $opts->{format} = interpolate( $opts->{format} )
47 0 ▶ if exists $opts->{format};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"format"} 0 0 0
48  
49 0 ▶ $opts->{stack} = $args->[0]
Branch: 1 branch
BranchTrueFalseTotal
if $args->[0] 0 0 0
50 if $args->[0];
51  
52 $self->usage_error('Cannot specify a stack when using --all')
53 0 ▶ if $opts->{stack} && $opts->{all};
Branch: 1 branch
BranchTrueFalseTotal
if $opts->{"stack"} and $opts->{"all"} 0 0 0
Condition0%0/3
$opts->{"stack"} and $opts->{"all"}
!ll&&!rl&&r
000
MC/DC0%0/2
$opts->{"stack"} and $opts->{"all"}
$opts->{"stack"} $opts->{"all"}
Truth table0%0/3
A and B
A= $opts->{"stack"}B= $opts->{"all"}
ABresult
0X0
100
111
54  
55 0 return 1;
56 }
57  
58 #------------------------------------------------------------------------------
59  
60 1 1;
61  
62 __END__
« blib/lib/Pinto/Locator/Stratopan.pm ↑ Summary blib/lib/Pinto/Action/Install.pm »