| 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
MC/DC0%0/1
$self->{"exit_code"} // 1
$self->{"exit_code"}
Truth table0%0/2
A
A= $self->{"exit_code"}
| |||||||||||||
| 37 | 0 | exit $exit_code; | |||||||||||
| 38 | } | ||||||||||||
| 39 | |||||||||||||
| 40 | 1 | 1; | |||||||||||
| 41 | # ABSTRACT: Exit program | ||||||||||||
| 42 | |||||||||||||
| 43 | __END__ | ||||||||||||