blib/lib/Langertha/Knarr/CLI/Role/GlobalOptions.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 24 / 24 CC 3 SCAR 5.1
CC
3
Cov
100%
config_file
2.0
verbose_enabled
2.0
BEGIN
1.0
CRAP 1.7
« blib/lib/Langertha/Knarr/TokenStore.pm ↑ Summary blib/lib/Langertha/Knarr/Handler/Code.pm »
1 package Langertha::Knarr::CLI::Role::GlobalOptions;
2 42 our $VERSION = '1.103';
3 # ABSTRACT: Accept knarr's global -c/-v options after the subcommand too
4 42 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 42 ▶use MooX::Options;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 42 option config => (
9 is => 'ro',
10 format => 's',
11 short => 'c',
12 doc => 'Config file path (default: ./knarr.yaml)',
13 predicate => 'has_config',
14 );
15  
16  
17 42 option verbose => (
18 is => 'ro',
19 short => 'v',
20 doc => 'Enable verbose logging (or set KNARR_DEBUG=1)',
21 negatable => 1,
22 predicate => 'has_verbose',
23 );
24  
25  
26 40 ▶sub config_file {
Subroutine config_file: called CC=2 SCAR=6.9
Pod documented
27 40 my ( $self, $chain ) = @_;
28 40 ▶ return $self->has_config ? $self->config : $chain->[0]->config;
Branch: 1 branch
BranchTrueFalseTotal
$self->has_config ? : 18 22 40
29 }
30  
31  
32 35 ▶sub verbose_enabled {
Subroutine verbose_enabled: called CC=2 SCAR=6.9
Pod documented
33 35 my ( $self, $chain ) = @_;
34 35 ▶ return $self->has_verbose ? $self->verbose : $chain->[0]->verbose;
Branch: 1 branch
BranchTrueFalseTotal
$self->has_verbose ? : 7 28 35
35 }
36  
37  
38 42 1;
39  
40 __END__
« blib/lib/Langertha/Knarr/TokenStore.pm ↑ Summary blib/lib/Langertha/Knarr/Handler/Code.pm »