bin/tools/lib/cli.pm

filter: Statementstmt 84.2% 16 / 19 Branchbran 33.3% 2 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 73.3% 22 / 30 SCAR 14.7
CC
4
Cov
72%
error
6.0
provide_help
3.1
BEGIN
1.0
CRAP 4.4
« lib/Serge/Engine/Plugin/process_if.pm ↑ Summary lib/Serge/Plugin/Base.pm »
1 package cli;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Getopt::Long qw(:config pass_through);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Pod::Usage;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub provide_help {
9 1 ▶ my $man = 0;
Subroutine provide_help: called CC=3 SCAR=11.3
10 1 my $help = 0;
11 1 GetOptions('help|?' => \$help, 'man' => \$man);
12  
13 # for --help option, show basic usage info and exit
14 1 ▶ pod2usage(-verbose => 1, -exitstatus => 0) if $help;
Branch: 1 branch
BranchTrueFalseTotal
if $help 0 1 1
15  
16 # for --man option, show the full POD documentation and exit
17 1 ▶ pod2usage(-verbose => 2, -exitstatus => 0, -noperldoc => 1) if $man;
Branch: 1 branch
BranchTrueFalseTotal
if $man 0 1 1
18 }
19  
20 sub error {
21 0 ▶ my ($message, $exitstatus) = @_;
Subroutine error: not called CC=2 SCAR=17.9
22 0 ▶ $exitstatus = 1 unless defined $exitstatus;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $exitstatus 0 0 0
23 # show message+synopsis and exit
24 0 pod2usage(-message => $message."\n", -verbose => 0, -exitstatus => $exitstatus);
25 }
26  
27 1 provide_help;
28  
29 1 1;
« lib/Serge/Engine/Plugin/process_if.pm ↑ Summary lib/Serge/Plugin/Base.pm »