| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package OptArgs2::OptArgBase; |
|
2
|
6
|
|
|
6
|
|
2960
|
use strict; |
|
|
6
|
|
|
|
|
11
|
|
|
|
6
|
|
|
|
|
246
|
|
|
3
|
6
|
|
|
6
|
|
46
|
use warnings; |
|
|
6
|
|
|
|
|
9
|
|
|
|
6
|
|
|
|
|
3987
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
### START Class::Inline ### v0.0.1 Wed Dec 3 12:04:29 2025 |
|
6
|
|
|
|
|
|
|
require Carp; |
|
7
|
|
|
|
|
|
|
our ( @_CLASS, $_FIELDS, %_NEW ); |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _NEW { |
|
10
|
21
|
|
|
21
|
|
33
|
CORE::state $fix_FIELDS = do { |
|
11
|
5
|
50
|
|
|
|
36
|
$_FIELDS = { @_CLASS > 1 ? @_CLASS : %{ $_CLASS[0] } }; |
|
|
0
|
|
|
|
|
0
|
|
|
12
|
5
|
50
|
|
|
|
39
|
$_FIELDS = $_FIELDS->{'FIELDS'} if exists $_FIELDS->{'FIELDS'}; |
|
13
|
|
|
|
|
|
|
}; |
|
14
|
21
|
50
|
|
|
|
45
|
if ( my @missing = grep { not exists $_[0]->{$_} } 'comment', 'name' ) { |
|
|
42
|
|
|
|
|
147
|
|
|
15
|
0
|
|
|
|
|
0
|
Carp::croak( 'OptArgs2::OptArgBase required initial argument(s): ' |
|
16
|
|
|
|
|
|
|
. join( ', ', @missing ) ); |
|
17
|
|
|
|
|
|
|
} |
|
18
|
21
|
|
|
|
|
59
|
map { delete $_[1]->{$_} } 'comment', 'default', 'encoding', 'getopt', |
|
|
147
|
|
|
|
|
296
|
|
|
19
|
|
|
|
|
|
|
'name', 'required', 'show_default'; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub __RO { |
|
23
|
0
|
|
|
0
|
|
0
|
my ( undef, undef, undef, $sub ) = caller(1); |
|
24
|
0
|
|
|
|
|
0
|
Carp::confess("attribute $sub is read-only"); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
10
|
50
|
50
|
10
|
0
|
28
|
sub comment { __RO() if @_ > 1; $_[0]{'comment'} // undef } |
|
|
10
|
|
|
|
|
59
|
|
|
27
|
25
|
50
|
100
|
25
|
0
|
77
|
sub default { __RO() if @_ > 1; $_[0]{'default'} // undef } |
|
|
25
|
|
|
|
|
179
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub encoding { |
|
30
|
2
|
50
|
|
2
|
0
|
7
|
__RO() if @_ > 1; |
|
31
|
2
|
|
33
|
|
|
10
|
$_[0]{'encoding'} //= $_FIELDS->{'encoding'}->{'default'}; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
18
|
50
|
50
|
18
|
0
|
40
|
sub getopt { __RO() if @_ > 1; $_[0]{'getopt'} // undef } |
|
|
18
|
|
|
|
|
103
|
|
|
34
|
49
|
50
|
50
|
49
|
0
|
103
|
sub name { __RO() if @_ > 1; $_[0]{'name'} // undef } |
|
|
49
|
|
|
|
|
213
|
|
|
35
|
44
|
50
|
100
|
44
|
0
|
87
|
sub required { __RO() if @_ > 1; $_[0]{'required'} // undef } |
|
|
44
|
|
|
|
|
235
|
|
|
36
|
10
|
50
|
50
|
10
|
0
|
22
|
sub show_default { __RO() if @_ > 1; $_[0]{'show_default'} // undef } |
|
|
10
|
|
|
|
|
61
|
|
|
37
|
|
|
|
|
|
|
@_CLASS = grep 1, ### END Class::Inline ### |
|
38
|
|
|
|
|
|
|
abstract => 1, |
|
39
|
|
|
|
|
|
|
FIELDS => { |
|
40
|
|
|
|
|
|
|
comment => { required => 1, }, |
|
41
|
|
|
|
|
|
|
default => {}, |
|
42
|
|
|
|
|
|
|
encoding => { default => ':encoding(UTF-8)' }, |
|
43
|
|
|
|
|
|
|
getopt => {}, |
|
44
|
|
|
|
|
|
|
name => { required => 1, }, |
|
45
|
|
|
|
|
|
|
required => {}, |
|
46
|
|
|
|
|
|
|
show_default => {}, |
|
47
|
|
|
|
|
|
|
}, |
|
48
|
|
|
|
|
|
|
; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
our @CARP_NOT = @OptArgs2::CARP_NOT; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |