blib/lib/Perinci/CmdLine/Plugin/Flow/Exit.pm

filter: Statementstmt 79.1% 19 / 24 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 66.6% 24 / 36 CC 2 SCAR 8.6
CC
2
Cov
73%
after_action
6.0
meta
2.0
BEGIN
1.0
CRAP 2.4
« blib/lib/Perinci/CmdLine/Plugin/Debug/DumpRes.pm ↑ Summary
1 package Perinci::CmdLine::Plugin::Flow::Exit;
2  
3 # put pragmas + Log::ger here
4 1 ▶use 5.010001; # for defined-or
Subroutine BEGIN: called CC=1 SCAR=0.0
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 1 ▶use Log::ger;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use parent 'Perinci::CmdLine::PluginBase';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # put other modules alphabetically here
11  
12 # put global variables alphabetically here
13 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
14 1 our $DATE = '2023-11-23'; # DATE
15 1 our $DIST = 'Perinci-CmdLine-Lite'; # DIST
16 1 our $VERSION = '1.929'; # VERSION
17  
18 0 ▶sub meta {
Subroutine meta: not called CC=1 SCAR=6.9
Pod undocumented
19 return {
20 0 summary => 'Exit program',
21 prio => 99, # by default very low, run after other plugins
22 conf => {
23 exit_code => {
24 schema => 'byte*',
25 default => 1,
26 },
27 },
28 tags => ['category:flow-control', 'category:debugging'],
29 };
30 }
31  
32 0 ▶sub after_action {
Subroutine after_action: not called CC=2 SCAR=17.9
Pod undocumented
33 0 require Data::Dump::Color;
34  
35 0 my ($self, $r) = @_;
36 0 ▶ my $exit_code = $self->{exit_code} // 1;
Condition0%0/2
$self->{"exit_code"} // 1
l!l
00
MC/DC0%0/1
$self->{"exit_code"} // 1
$self->{"exit_code"}
Truth table0%0/2
A
A= $self->{"exit_code"}
Aresult
11
00
37 0 exit $exit_code;
38 }
39  
40 1 1;
41 # ABSTRACT: Exit program
42  
43 __END__
« blib/lib/Perinci/CmdLine/Plugin/Debug/DumpRes.pm ↑ Summary