Footprintless/App/Command/log/cat.pm

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 4 / 4 totaltotal 97.7% 43 / 44 CC 3 SCAR 3.1
CC
3
Cov
97%
validate_args
2.0
execute
2.0
BEGIN
1.0
CRAP 1.4
« Footprintless/App/Command/log/grep.pm ↑ Summary Footprintless/CommandRunner.pm »
1 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Footprintless::App::Command::log::cat;
5 5 $Footprintless::App::Command::log::cat::VERSION = '1.29';
6 # ABSTRACT: output a file
7 # PODNAME: Footprintless::App::Command::log::cat
8  
9 5 ▶use parent qw(Footprintless::App::Action);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶use Footprintless::App -ignore;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Log::Any;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 5 my $logger = Log::Any->get_logger();
15  
16 3 ▶sub execute {
Subroutine execute: called CC=2 SCAR=6.9
Pod documented
17 3 my ( $self, $opts, $args ) = @_;
18  
19 $self->{log}->cat(
20 runner_options => { out_handle => \*STDOUT },
21 3 ▶ ( $opts->{arg} ? ( args => $opts->{arg} ) : () )
Branch: 1 branch
BranchTrueFalseTotal
$opts->{'arg'} ? : 2 1 3
22 );
23  
24 3 $logger->info('Done...');
25 }
26  
27 3 ▶sub opt_spec {
Subroutine opt_spec: called CC=1 SCAR=0.0
Pod documented
28 3 return ( [ 'arg=s@', 'an argument passed to the command' ] );
29 }
30  
31 3 ▶sub usage_desc {
Subroutine usage_desc: called CC=1 SCAR=0.0
Pod documented
32 3 return "fpl log LOG_COORD cat %o";
33 }
34  
35 3 ▶sub validate_args {
Subroutine validate_args: called CC=2 SCAR=7.0
Pod documented
36 3 my ( $self, $opts, $args ) = @_;
37  
38 3 eval { $self->{log} = $self->{footprintless}->log( $self->{coordinate} ); };
39 3 ▶ $self->usage_error("invalid coordinate [$self->{coordinate}]: $@") if ($@);
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 3 3
40 }
41  
42 5 1;
43  
44 __END__
« Footprintless/App/Command/log/grep.pm ↑ Summary Footprintless/CommandRunner.pm »