| 1 | package Getopt::Long::Descriptive::Patch::DumpAndExit; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | our $DATE = '2016-10-27'; # DATE | |||||||||
| 4 | 1 | our $VERSION = '0.001'; # VERSION | |||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | no warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Data::Dmp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use Module::Patch 0.19 qw(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | use base qw(Module::Patch); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | our %config; | |||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub _dump { | ||||||||
|
Subroutine
_dump: not called CC=1 SCAR=6.9
| |||||||||||
| 17 | 0 | print "# BEGIN DUMP $config{-tag}\n"; | |||||||||
| 18 | 0 | local $Data::Dmp::OPT_DEPARSE = 0; | |||||||||
| 19 | 0 | say dmp($_[0]); | |||||||||
| 20 | 0 | print "# END DUMP $config{-tag}\n"; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | sub _build_describe_options { | ||||||||
|
Subroutine
_build_describe_options: not called CC=1 SCAR=6.9
| |||||||||||
| 24 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 25 | 0 | _dump(\@_); | |||||||||
| 26 | 0 | ▶ | $config{-exit_method} eq 'exit' ? exit(0) : die; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | }, | ||||||||||
| 28 | 0 | } | |||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub patch_data { | ||||||||
|
Subroutine
patch_data: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 31 | return { | ||||||||||
| 32 | 0 | v => 3, | |||||||||
| 33 | patches => [ | ||||||||||
| 34 | { | ||||||||||
| 35 | action => 'replace', | ||||||||||
| 36 | sub_name => '_build_describe_options', | ||||||||||
| 37 | code => \&_build_describe_options, | ||||||||||
| 38 | }, | ||||||||||
| 39 | ], | ||||||||||
| 40 | config => { | ||||||||||
| 41 | -tag => { | ||||||||||
| 42 | schema => 'str*', | ||||||||||
| 43 | default => 'TAG', | ||||||||||
| 44 | }, | ||||||||||
| 45 | -exit_method => { | ||||||||||
| 46 | schema => 'str*', | ||||||||||
| 47 | default => 'exit', | ||||||||||
| 48 | }, | ||||||||||
| 49 | }, | ||||||||||
| 50 | }; | ||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 1 | 1; | |||||||||
| 54 | # ABSTRACT: Patch Getopt::Long::Descriptive to dump option spec and exit | ||||||||||
| 55 | |||||||||||
| 56 | __END__ | ||||||||||