line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Driver::ArgParserRole; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
18144
|
use Modern::Perl; |
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
195
|
|
4
|
18
|
|
|
18
|
|
3332
|
use Moose::Role; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
185
|
|
5
|
18
|
|
|
18
|
|
106555
|
use namespace::autoclean; |
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
234
|
|
6
|
18
|
|
|
18
|
|
1701
|
use Kavorka '-all'; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
184
|
|
7
|
18
|
|
|
18
|
|
75518
|
use Data::Printer alias => 'pdump'; |
|
18
|
|
|
|
|
86
|
|
|
18
|
|
|
|
|
232
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
######################################################################################### |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
######################################################################################### |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=pod orig |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
method _parse_req_args (HashRef :$type_href) { |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my @ret; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
foreach my $subtype ( keys %$type_href ) { |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $hard; |
22
|
|
|
|
|
|
|
if ( $subtype eq 'hard' ) { |
23
|
|
|
|
|
|
|
$hard = 1; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
elsif ( $subtype eq 'soft' ) { |
26
|
|
|
|
|
|
|
$hard = 0; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
|
|
|
|
|
|
$self->warn("unrecognized required arg subtype: $subtype"); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $subtype_href = $type_href->{$subtype}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
foreach my $cli_arg ( keys %$subtype_href ) { |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $method_arg = $subtype_href->{$cli_arg}; |
37
|
|
|
|
|
|
|
my $opt = CLI::Driver::Option->new( |
38
|
|
|
|
|
|
|
required => 1, |
39
|
|
|
|
|
|
|
hard => $hard, |
40
|
|
|
|
|
|
|
cli_arg => $cli_arg, |
41
|
|
|
|
|
|
|
method_arg => $method_arg |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
push @ret, $opt; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return @ret; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# synonym for _parse_req_args |
54
|
18
|
0
|
0
|
18
|
|
60856
|
method _parse_req_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
69
|
|
|
18
|
0
|
|
18
|
|
2652
|
|
|
18
|
0
|
|
18
|
|
151
|
|
|
18
|
0
|
|
18
|
|
57
|
|
|
18
|
0
|
|
0
|
|
1024
|
|
|
18
|
|
|
|
|
130
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
190
|
|
|
18
|
|
|
|
|
1864
|
|
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
7121
|
|
|
18
|
|
|
|
|
143
|
|
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
2867
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
0
|
return $self->_parse_req_args(@_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
18
|
50
|
33
|
18
|
|
53604
|
method _parse_req_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
65
|
|
|
18
|
50
|
|
18
|
|
2364
|
|
|
18
|
50
|
|
18
|
|
167
|
|
|
18
|
50
|
|
18
|
|
54
|
|
|
18
|
50
|
|
357
|
|
1026
|
|
|
18
|
|
|
|
|
146
|
|
|
18
|
|
|
|
|
51
|
|
|
18
|
|
|
|
|
138
|
|
|
18
|
|
|
|
|
1584
|
|
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
7213
|
|
|
18
|
|
|
|
|
145
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
4971
|
|
|
357
|
|
|
|
|
900
|
|
|
357
|
|
|
|
|
718
|
|
|
357
|
|
|
|
|
525
|
|
|
357
|
|
|
|
|
1085
|
|
|
0
|
|
|
|
|
0
|
|
|
357
|
|
|
|
|
549
|
|
|
357
|
|
|
|
|
722
|
|
|
357
|
|
|
|
|
881
|
|
|
0
|
|
|
|
|
0
|
|
|
357
|
|
|
|
|
880
|
|
|
357
|
|
|
|
|
741
|
|
|
357
|
|
|
|
|
897
|
|
|
357
|
|
|
|
|
934
|
|
|
357
|
|
|
|
|
558
|
|
|
357
|
|
|
|
|
886
|
|
|
357
|
|
|
|
|
1806
|
|
|
357
|
|
|
|
|
949
|
|
|
357
|
|
|
|
|
863
|
|
|
357
|
|
|
|
|
600
|
|
|
357
|
|
|
|
|
785
|
|
|
357
|
|
|
|
|
502
|
|
60
|
|
|
|
|
|
|
|
61
|
357
|
|
|
|
|
545
|
my @ret; |
62
|
|
|
|
|
|
|
|
63
|
357
|
|
|
|
|
1027
|
foreach my $cli_arg ( keys %$type_href ) { |
64
|
|
|
|
|
|
|
|
65
|
544
|
100
|
100
|
|
|
1836
|
if ( $cli_arg eq 'hard' or $cli_arg eq 'soft' ) { |
66
|
476
|
|
|
|
|
1333
|
push @ret, |
67
|
|
|
|
|
|
|
$self->_parse_req_args_v1( |
68
|
|
|
|
|
|
|
type_href => $type_href, |
69
|
|
|
|
|
|
|
subtype => $cli_arg |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
else { |
73
|
68
|
|
|
|
|
291
|
push @ret, |
74
|
|
|
|
|
|
|
$self->_parse_req_args_v2( |
75
|
|
|
|
|
|
|
type_href => $type_href, |
76
|
|
|
|
|
|
|
cli_arg => $cli_arg |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
357
|
|
|
|
|
1134
|
return @ret; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
method _parse_req_args_v2 (HashRef :$type_href!, |
85
|
18
|
50
|
33
|
18
|
|
65379
|
Str :$cli_arg! ) { |
|
18
|
50
|
33
|
18
|
|
51
|
|
|
18
|
50
|
|
18
|
|
2547
|
|
|
18
|
50
|
|
18
|
|
147
|
|
|
18
|
50
|
|
18
|
|
53
|
|
|
18
|
50
|
|
18
|
|
986
|
|
|
18
|
50
|
|
68
|
|
164
|
|
|
18
|
50
|
|
|
|
45
|
|
|
18
|
50
|
|
|
|
136
|
|
|
18
|
|
|
|
|
1642
|
|
|
18
|
|
|
|
|
53
|
|
|
18
|
|
|
|
|
7191
|
|
|
18
|
|
|
|
|
197
|
|
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
3488
|
|
|
18
|
|
|
|
|
167
|
|
|
18
|
|
|
|
|
54
|
|
|
18
|
|
|
|
|
4358
|
|
|
68
|
|
|
|
|
340
|
|
|
68
|
|
|
|
|
130
|
|
|
68
|
|
|
|
|
116
|
|
|
68
|
|
|
|
|
304
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
178
|
|
|
68
|
|
|
|
|
142
|
|
|
68
|
|
|
|
|
197
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
223
|
|
|
136
|
|
|
|
|
236
|
|
|
136
|
|
|
|
|
301
|
|
|
136
|
|
|
|
|
317
|
|
|
68
|
|
|
|
|
120
|
|
|
68
|
|
|
|
|
273
|
|
|
68
|
|
|
|
|
469
|
|
|
68
|
|
|
|
|
244
|
|
|
68
|
|
|
|
|
204
|
|
|
68
|
|
|
|
|
111
|
|
|
68
|
|
|
|
|
179
|
|
|
68
|
|
|
|
|
198
|
|
|
68
|
|
|
|
|
177
|
|
|
68
|
|
|
|
|
103
|
|
|
68
|
|
|
|
|
232
|
|
|
68
|
|
|
|
|
121
|
|
86
|
|
|
|
|
|
|
|
87
|
68
|
|
|
|
|
184
|
my $method_arg = $type_href->{$cli_arg}; |
88
|
|
|
|
|
|
|
|
89
|
68
|
|
|
|
|
125
|
my $is_array = 0; |
90
|
68
|
50
|
|
|
|
237
|
if( $method_arg =~ s/^\@(.+)/$1/ ){ |
91
|
0
|
|
|
|
|
0
|
$is_array = 1; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
68
|
100
|
|
|
|
2309
|
return CLI::Driver::Option->new( |
95
|
|
|
|
|
|
|
required => 1, |
96
|
|
|
|
|
|
|
hard => 1, |
97
|
|
|
|
|
|
|
cli_arg => $cli_arg, |
98
|
|
|
|
|
|
|
method_arg => $method_arg, |
99
|
|
|
|
|
|
|
is_array => $is_array, |
100
|
|
|
|
|
|
|
use_argv_map => $self->use_argv_map ? 1 : 0 |
101
|
|
|
|
|
|
|
); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
method _parse_req_args_v1 (HashRef :$type_href!, |
105
|
18
|
50
|
33
|
18
|
|
65754
|
Str :$subtype! ) { |
|
18
|
50
|
33
|
18
|
|
54
|
|
|
18
|
50
|
|
18
|
|
2355
|
|
|
18
|
50
|
|
18
|
|
146
|
|
|
18
|
50
|
|
18
|
|
49
|
|
|
18
|
50
|
|
18
|
|
926
|
|
|
18
|
50
|
|
476
|
|
142
|
|
|
18
|
50
|
|
|
|
44
|
|
|
18
|
50
|
|
|
|
141
|
|
|
18
|
|
|
|
|
1807
|
|
|
18
|
|
|
|
|
63
|
|
|
18
|
|
|
|
|
7309
|
|
|
18
|
|
|
|
|
151
|
|
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
3101
|
|
|
18
|
|
|
|
|
140
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
6840
|
|
|
476
|
|
|
|
|
1078
|
|
|
476
|
|
|
|
|
794
|
|
|
476
|
|
|
|
|
696
|
|
|
476
|
|
|
|
|
1281
|
|
|
0
|
|
|
|
|
0
|
|
|
476
|
|
|
|
|
704
|
|
|
476
|
|
|
|
|
993
|
|
|
476
|
|
|
|
|
1391
|
|
|
0
|
|
|
|
|
0
|
|
|
476
|
|
|
|
|
981
|
|
|
952
|
|
|
|
|
1895
|
|
|
952
|
|
|
|
|
1906
|
|
|
952
|
|
|
|
|
2004
|
|
|
476
|
|
|
|
|
747
|
|
|
476
|
|
|
|
|
1342
|
|
|
476
|
|
|
|
|
2830
|
|
|
476
|
|
|
|
|
1300
|
|
|
476
|
|
|
|
|
982
|
|
|
476
|
|
|
|
|
701
|
|
|
476
|
|
|
|
|
931
|
|
|
476
|
|
|
|
|
1002
|
|
|
476
|
|
|
|
|
934
|
|
|
476
|
|
|
|
|
704
|
|
|
476
|
|
|
|
|
1308
|
|
|
476
|
|
|
|
|
662
|
|
106
|
|
|
|
|
|
|
|
107
|
476
|
|
|
|
|
812
|
my @ret; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $hard; |
110
|
476
|
100
|
|
|
|
1075
|
if ( $subtype eq 'hard' ) { |
|
|
50
|
|
|
|
|
|
111
|
289
|
|
|
|
|
452
|
$hard = 1; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
elsif ( $subtype eq 'soft' ) { |
114
|
187
|
|
|
|
|
305
|
$hard = 0; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
else { |
117
|
0
|
|
|
|
|
0
|
$self->warn("unrecognized required arg subtype: $subtype"); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
476
|
|
|
|
|
748
|
my $subtype_href = $type_href->{$subtype}; |
121
|
|
|
|
|
|
|
|
122
|
476
|
|
|
|
|
1351
|
foreach my $cli_arg ( keys %$subtype_href ) { |
123
|
|
|
|
|
|
|
|
124
|
289
|
|
|
|
|
556
|
my $method_arg = $subtype_href->{$cli_arg}; |
125
|
|
|
|
|
|
|
|
126
|
289
|
|
|
|
|
434
|
my $is_array = 0; |
127
|
289
|
100
|
|
|
|
1117
|
if( $method_arg =~ s/^\@(.+)$/$1/ ){ |
128
|
51
|
|
|
|
|
114
|
$is_array = 1; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
289
|
100
|
|
|
|
9862
|
push @ret, |
132
|
|
|
|
|
|
|
CLI::Driver::Option->new( |
133
|
|
|
|
|
|
|
required => 1, |
134
|
|
|
|
|
|
|
hard => $hard, |
135
|
|
|
|
|
|
|
cli_arg => $cli_arg, |
136
|
|
|
|
|
|
|
method_arg => $method_arg, |
137
|
|
|
|
|
|
|
is_array => $is_array, |
138
|
|
|
|
|
|
|
use_argv_map => $self->use_argv_map ? 1 : 0 |
139
|
|
|
|
|
|
|
); |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
476
|
|
|
|
|
1677
|
return @ret; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# alias for _parse_opt_args |
146
|
18
|
0
|
0
|
18
|
|
53487
|
method _parse_opt_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
51
|
|
|
18
|
0
|
|
18
|
|
2310
|
|
|
18
|
0
|
|
18
|
|
144
|
|
|
18
|
0
|
|
18
|
|
54
|
|
|
18
|
0
|
|
0
|
|
966
|
|
|
18
|
|
|
|
|
123
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
135
|
|
|
18
|
|
|
|
|
1579
|
|
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
7287
|
|
|
18
|
|
|
|
|
140
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
2888
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
147
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
0
|
return $self->_parse_opt_args(@_); |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
18
|
50
|
33
|
18
|
|
52940
|
method _parse_opt_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
47
|
|
|
18
|
50
|
|
18
|
|
2246
|
|
|
18
|
50
|
|
18
|
|
144
|
|
|
18
|
50
|
|
18
|
|
40
|
|
|
18
|
50
|
|
204
|
|
1111
|
|
|
18
|
|
|
|
|
131
|
|
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
130
|
|
|
18
|
|
|
|
|
1655
|
|
|
18
|
|
|
|
|
74
|
|
|
18
|
|
|
|
|
6796
|
|
|
18
|
|
|
|
|
145
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
5852
|
|
|
204
|
|
|
|
|
536
|
|
|
204
|
|
|
|
|
435
|
|
|
204
|
|
|
|
|
318
|
|
|
204
|
|
|
|
|
650
|
|
|
0
|
|
|
|
|
0
|
|
|
204
|
|
|
|
|
365
|
|
|
204
|
|
|
|
|
390
|
|
|
204
|
|
|
|
|
541
|
|
|
0
|
|
|
|
|
0
|
|
|
204
|
|
|
|
|
555
|
|
|
204
|
|
|
|
|
422
|
|
|
204
|
|
|
|
|
528
|
|
|
204
|
|
|
|
|
565
|
|
|
204
|
|
|
|
|
330
|
|
|
204
|
|
|
|
|
651
|
|
|
204
|
|
|
|
|
1103
|
|
|
204
|
|
|
|
|
579
|
|
|
204
|
|
|
|
|
470
|
|
|
204
|
|
|
|
|
346
|
|
|
204
|
|
|
|
|
487
|
|
|
204
|
|
|
|
|
296
|
|
152
|
|
|
|
|
|
|
|
153
|
204
|
|
|
|
|
319
|
my @ret; |
154
|
|
|
|
|
|
|
|
155
|
204
|
|
|
|
|
576
|
foreach my $cli_arg ( keys %$type_href ) { |
156
|
|
|
|
|
|
|
|
157
|
221
|
|
|
|
|
441
|
my $method_arg = $type_href->{$cli_arg}; |
158
|
|
|
|
|
|
|
|
159
|
221
|
|
|
|
|
336
|
my $is_array = 0; |
160
|
221
|
100
|
|
|
|
780
|
if( $method_arg =~ s/^\@(.+)$/$1/ ){ |
161
|
34
|
|
|
|
|
87
|
$is_array = 1; |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
221
|
100
|
|
|
|
7390
|
my $opt = CLI::Driver::Option->new( |
165
|
|
|
|
|
|
|
required => 0, |
166
|
|
|
|
|
|
|
cli_arg => $cli_arg, |
167
|
|
|
|
|
|
|
method_arg => $method_arg, |
168
|
|
|
|
|
|
|
is_array => $is_array, |
169
|
|
|
|
|
|
|
use_argv_map => $self->use_argv_map ? 1 : 0 |
170
|
|
|
|
|
|
|
); |
171
|
|
|
|
|
|
|
|
172
|
221
|
|
|
|
|
653
|
push @ret, $opt; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
204
|
|
|
|
|
716
|
return @ret; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# alias for _parse_flag_args |
179
|
18
|
0
|
0
|
18
|
|
53085
|
method _parse_flag_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
92
|
|
|
18
|
0
|
|
18
|
|
2457
|
|
|
18
|
0
|
|
18
|
|
151
|
|
|
18
|
0
|
|
18
|
|
54
|
|
|
18
|
0
|
|
0
|
|
979
|
|
|
18
|
|
|
|
|
134
|
|
|
18
|
|
|
|
|
59
|
|
|
18
|
|
|
|
|
132
|
|
|
18
|
|
|
|
|
1630
|
|
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
6839
|
|
|
18
|
|
|
|
|
170
|
|
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
2895
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
180
|
|
|
|
|
|
|
|
181
|
0
|
|
|
|
|
0
|
return $self->_parse_flag_args(@_); |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
18
|
50
|
33
|
18
|
|
52602
|
method _parse_flag_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
83
|
|
|
18
|
50
|
|
18
|
|
2415
|
|
|
18
|
50
|
|
18
|
|
147
|
|
|
18
|
50
|
|
18
|
|
44
|
|
|
18
|
50
|
|
68
|
|
979
|
|
|
18
|
|
|
|
|
125
|
|
|
18
|
|
|
|
|
53
|
|
|
18
|
|
|
|
|
174
|
|
|
18
|
|
|
|
|
1586
|
|
|
18
|
|
|
|
|
60
|
|
|
18
|
|
|
|
|
8160
|
|
|
18
|
|
|
|
|
144
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
4457
|
|
|
68
|
|
|
|
|
230
|
|
|
68
|
|
|
|
|
135
|
|
|
68
|
|
|
|
|
127
|
|
|
68
|
|
|
|
|
288
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
132
|
|
|
68
|
|
|
|
|
145
|
|
|
68
|
|
|
|
|
230
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
222
|
|
|
68
|
|
|
|
|
164
|
|
|
68
|
|
|
|
|
223
|
|
|
68
|
|
|
|
|
195
|
|
|
68
|
|
|
|
|
141
|
|
|
68
|
|
|
|
|
215
|
|
|
68
|
|
|
|
|
379
|
|
|
68
|
|
|
|
|
254
|
|
|
68
|
|
|
|
|
188
|
|
|
68
|
|
|
|
|
129
|
|
|
68
|
|
|
|
|
180
|
|
|
68
|
|
|
|
|
103
|
|
185
|
|
|
|
|
|
|
|
186
|
68
|
|
|
|
|
120
|
my @ret; |
187
|
|
|
|
|
|
|
|
188
|
68
|
|
|
|
|
254
|
foreach my $cli_arg ( keys %$type_href ) { |
189
|
|
|
|
|
|
|
|
190
|
68
|
|
|
|
|
160
|
my $method_arg = $type_href->{$cli_arg}; |
191
|
|
|
|
|
|
|
|
192
|
68
|
100
|
|
|
|
2362
|
my $opt = CLI::Driver::Option->new( |
193
|
|
|
|
|
|
|
required => 0, |
194
|
|
|
|
|
|
|
cli_arg => $cli_arg, |
195
|
|
|
|
|
|
|
method_arg => $method_arg, |
196
|
|
|
|
|
|
|
flag => 1, |
197
|
|
|
|
|
|
|
use_argv_map => $self->use_argv_map ? 1 : 0, |
198
|
|
|
|
|
|
|
); |
199
|
|
|
|
|
|
|
|
200
|
68
|
|
|
|
|
201
|
push @ret, $opt; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
68
|
|
|
|
|
250
|
return @ret; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
18
|
50
|
33
|
18
|
|
44449
|
method _parse_attrs (HashRef :$href!) { |
|
18
|
50
|
33
|
18
|
|
47
|
|
|
18
|
50
|
|
18
|
|
3462
|
|
|
18
|
50
|
|
18
|
|
237
|
|
|
18
|
50
|
|
18
|
|
41
|
|
|
18
|
50
|
|
272
|
|
916
|
|
|
18
|
|
|
|
|
117
|
|
|
18
|
|
|
|
|
60
|
|
|
18
|
|
|
|
|
127
|
|
|
18
|
|
|
|
|
1689
|
|
|
18
|
|
|
|
|
50
|
|
|
18
|
|
|
|
|
7328
|
|
|
18
|
|
|
|
|
149
|
|
|
18
|
|
|
|
|
58
|
|
|
18
|
|
|
|
|
3300
|
|
|
272
|
|
|
|
|
711
|
|
|
272
|
|
|
|
|
514
|
|
|
272
|
|
|
|
|
405
|
|
|
272
|
|
|
|
|
865
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
504
|
|
|
272
|
|
|
|
|
536
|
|
|
272
|
|
|
|
|
709
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
642
|
|
|
272
|
|
|
|
|
524
|
|
|
272
|
|
|
|
|
710
|
|
|
272
|
|
|
|
|
715
|
|
|
272
|
|
|
|
|
455
|
|
|
272
|
|
|
|
|
773
|
|
|
272
|
|
|
|
|
1409
|
|
|
272
|
|
|
|
|
781
|
|
|
272
|
|
|
|
|
666
|
|
|
272
|
|
|
|
|
424
|
|
|
272
|
|
|
|
|
695
|
|
|
272
|
|
|
|
|
415
|
|
207
|
|
|
|
|
|
|
|
208
|
272
|
100
|
|
|
|
805
|
my $attr_href = defined $href->{attr} ? $href->{attr} : {}; |
209
|
272
|
|
|
|
|
854
|
return $self->__parse_args( args_href => $attr_href ); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
18
|
50
|
33
|
18
|
|
44071
|
method _parse_args (HashRef :$href!) { |
|
18
|
50
|
33
|
18
|
|
84
|
|
|
18
|
50
|
|
18
|
|
2526
|
|
|
18
|
50
|
|
18
|
|
146
|
|
|
18
|
50
|
|
18
|
|
46
|
|
|
18
|
50
|
|
272
|
|
967
|
|
|
18
|
|
|
|
|
117
|
|
|
18
|
|
|
|
|
125
|
|
|
18
|
|
|
|
|
172
|
|
|
18
|
|
|
|
|
1571
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
6991
|
|
|
18
|
|
|
|
|
139
|
|
|
18
|
|
|
|
|
82
|
|
|
18
|
|
|
|
|
3239
|
|
|
272
|
|
|
|
|
777
|
|
|
272
|
|
|
|
|
506
|
|
|
272
|
|
|
|
|
427
|
|
|
272
|
|
|
|
|
873
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
477
|
|
|
272
|
|
|
|
|
556
|
|
|
272
|
|
|
|
|
748
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
678
|
|
|
272
|
|
|
|
|
496
|
|
|
272
|
|
|
|
|
716
|
|
|
272
|
|
|
|
|
818
|
|
|
272
|
|
|
|
|
472
|
|
|
272
|
|
|
|
|
723
|
|
|
272
|
|
|
|
|
1352
|
|
|
272
|
|
|
|
|
778
|
|
|
272
|
|
|
|
|
644
|
|
|
272
|
|
|
|
|
426
|
|
|
272
|
|
|
|
|
604
|
|
|
272
|
|
|
|
|
415
|
|
213
|
|
|
|
|
|
|
|
214
|
272
|
100
|
|
|
|
673
|
my $args_href = defined $href->{args} ? $href->{args} : {}; |
215
|
272
|
|
|
|
|
760
|
return $self->__parse_args( args_href => $args_href ); |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
18
|
50
|
33
|
18
|
|
45751
|
method __parse_args (HashRef :$args_href!) { |
|
18
|
50
|
33
|
18
|
|
45
|
|
|
18
|
50
|
|
18
|
|
2514
|
|
|
18
|
50
|
|
18
|
|
142
|
|
|
18
|
50
|
|
18
|
|
46
|
|
|
18
|
50
|
|
544
|
|
908
|
|
|
18
|
|
|
|
|
118
|
|
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
119
|
|
|
18
|
|
|
|
|
1685
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
7338
|
|
|
18
|
|
|
|
|
146
|
|
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
8786
|
|
|
544
|
|
|
|
|
1183
|
|
|
544
|
|
|
|
|
913
|
|
|
544
|
|
|
|
|
760
|
|
|
544
|
|
|
|
|
1513
|
|
|
0
|
|
|
|
|
0
|
|
|
544
|
|
|
|
|
849
|
|
|
544
|
|
|
|
|
976
|
|
|
544
|
|
|
|
|
1218
|
|
|
0
|
|
|
|
|
0
|
|
|
544
|
|
|
|
|
1137
|
|
|
544
|
|
|
|
|
932
|
|
|
544
|
|
|
|
|
1234
|
|
|
544
|
|
|
|
|
1345
|
|
|
544
|
|
|
|
|
819
|
|
|
544
|
|
|
|
|
1267
|
|
|
544
|
|
|
|
|
2212
|
|
|
544
|
|
|
|
|
1297
|
|
|
544
|
|
|
|
|
1174
|
|
|
544
|
|
|
|
|
735
|
|
|
544
|
|
|
|
|
1062
|
|
|
544
|
|
|
|
|
813
|
|
219
|
|
|
|
|
|
|
|
220
|
544
|
|
|
|
|
829
|
my @args; |
221
|
|
|
|
|
|
|
|
222
|
544
|
|
|
|
|
1491
|
foreach my $type ( keys %$args_href ) { |
223
|
|
|
|
|
|
|
|
224
|
969
|
|
|
|
|
1639
|
my $type_href = $args_href->{$type}; |
225
|
|
|
|
|
|
|
|
226
|
969
|
100
|
|
|
|
1904
|
if ( defined $type_href ) { |
227
|
629
|
100
|
|
|
|
2756
|
if ( $type =~ /^opt/ ) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
228
|
204
|
|
|
|
|
682
|
my @opt = $self->_parse_opt_args( type_href => $type_href ); |
229
|
204
|
|
|
|
|
504
|
push @args, @opt; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
elsif ( $type =~ /^req/ ) { |
232
|
357
|
|
|
|
|
1216
|
my @req = $self->_parse_req_args( type_href => $type_href ); |
233
|
357
|
|
|
|
|
861
|
push @args, @req; |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
elsif ( $type =~ /^flag/ ) { |
236
|
68
|
|
|
|
|
313
|
my @flag = $self->_parse_flag_args( type_href => $type_href ); |
237
|
68
|
|
|
|
|
189
|
push @args, @flag; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
else { |
240
|
0
|
|
|
|
|
0
|
$self->warn("unrecognized type: $type"); |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
544
|
|
|
|
|
2250
|
return \@args; |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
1; |
249
|
|
|
|
|
|
|
|