line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Driver::ArgParserRole; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
14871
|
use Modern::Perl; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
167
|
|
4
|
18
|
|
|
18
|
|
2886
|
use Moose::Role; |
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
161
|
|
5
|
18
|
|
|
18
|
|
93224
|
use namespace::autoclean; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
161
|
|
6
|
18
|
|
|
18
|
|
1450
|
use Kavorka '-all'; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
145
|
|
7
|
18
|
|
|
18
|
|
65612
|
use Data::Printer alias => 'pdump'; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
188
|
|
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
|
|
52539
|
method _parse_req_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
39
|
|
|
18
|
0
|
|
18
|
|
2155
|
|
|
18
|
0
|
|
18
|
|
124
|
|
|
18
|
0
|
|
18
|
|
35
|
|
|
18
|
0
|
|
0
|
|
889
|
|
|
18
|
|
|
|
|
108
|
|
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
157
|
|
|
18
|
|
|
|
|
1643
|
|
|
18
|
|
|
|
|
57
|
|
|
18
|
|
|
|
|
6431
|
|
|
18
|
|
|
|
|
160
|
|
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
2555
|
|
|
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
|
|
43985
|
method _parse_req_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
61
|
|
|
18
|
50
|
|
18
|
|
1947
|
|
|
18
|
50
|
|
18
|
|
151
|
|
|
18
|
50
|
|
18
|
|
57
|
|
|
18
|
50
|
|
357
|
|
1191
|
|
|
18
|
|
|
|
|
153
|
|
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
100
|
|
|
18
|
|
|
|
|
1329
|
|
|
18
|
|
|
|
|
64
|
|
|
18
|
|
|
|
|
6293
|
|
|
18
|
|
|
|
|
126
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
4410
|
|
|
357
|
|
|
|
|
826
|
|
|
357
|
|
|
|
|
591
|
|
|
357
|
|
|
|
|
469
|
|
|
357
|
|
|
|
|
958
|
|
|
0
|
|
|
|
|
0
|
|
|
357
|
|
|
|
|
537
|
|
|
357
|
|
|
|
|
579
|
|
|
357
|
|
|
|
|
795
|
|
|
0
|
|
|
|
|
0
|
|
|
357
|
|
|
|
|
733
|
|
|
357
|
|
|
|
|
604
|
|
|
357
|
|
|
|
|
811
|
|
|
357
|
|
|
|
|
919
|
|
|
357
|
|
|
|
|
498
|
|
|
357
|
|
|
|
|
817
|
|
|
357
|
|
|
|
|
1493
|
|
|
357
|
|
|
|
|
893
|
|
|
357
|
|
|
|
|
696
|
|
|
357
|
|
|
|
|
443
|
|
|
357
|
|
|
|
|
670
|
|
|
357
|
|
|
|
|
422
|
|
60
|
|
|
|
|
|
|
|
61
|
357
|
|
|
|
|
470
|
my @ret; |
62
|
|
|
|
|
|
|
|
63
|
357
|
|
|
|
|
986
|
foreach my $cli_arg ( keys %$type_href ) { |
64
|
|
|
|
|
|
|
|
65
|
544
|
100
|
100
|
|
|
2028
|
if ( $cli_arg eq 'hard' or $cli_arg eq 'soft' ) { |
66
|
476
|
|
|
|
|
1325
|
push @ret, |
67
|
|
|
|
|
|
|
$self->_parse_req_args_v1( |
68
|
|
|
|
|
|
|
type_href => $type_href, |
69
|
|
|
|
|
|
|
subtype => $cli_arg |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
else { |
73
|
68
|
|
|
|
|
249
|
push @ret, |
74
|
|
|
|
|
|
|
$self->_parse_req_args_v2( |
75
|
|
|
|
|
|
|
type_href => $type_href, |
76
|
|
|
|
|
|
|
cli_arg => $cli_arg |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
357
|
|
|
|
|
946
|
return @ret; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
method _parse_req_args_v2 (HashRef :$type_href!, |
85
|
18
|
50
|
33
|
18
|
|
54930
|
Str :$cli_arg! ) { |
|
18
|
50
|
33
|
18
|
|
43
|
|
|
18
|
50
|
|
18
|
|
2014
|
|
|
18
|
50
|
|
18
|
|
128
|
|
|
18
|
50
|
|
18
|
|
47
|
|
|
18
|
50
|
|
18
|
|
766
|
|
|
18
|
50
|
|
68
|
|
104
|
|
|
18
|
50
|
|
|
|
75
|
|
|
18
|
50
|
|
|
|
115
|
|
|
18
|
|
|
|
|
1334
|
|
|
18
|
|
|
|
|
57
|
|
|
18
|
|
|
|
|
6209
|
|
|
18
|
|
|
|
|
141
|
|
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
2821
|
|
|
18
|
|
|
|
|
146
|
|
|
18
|
|
|
|
|
54
|
|
|
18
|
|
|
|
|
3748
|
|
|
68
|
|
|
|
|
188
|
|
|
68
|
|
|
|
|
115
|
|
|
68
|
|
|
|
|
102
|
|
|
68
|
|
|
|
|
253
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
125
|
|
|
68
|
|
|
|
|
140
|
|
|
68
|
|
|
|
|
193
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
232
|
|
|
136
|
|
|
|
|
255
|
|
|
136
|
|
|
|
|
276
|
|
|
136
|
|
|
|
|
339
|
|
|
68
|
|
|
|
|
110
|
|
|
68
|
|
|
|
|
210
|
|
|
68
|
|
|
|
|
512
|
|
|
68
|
|
|
|
|
227
|
|
|
68
|
|
|
|
|
199
|
|
|
68
|
|
|
|
|
121
|
|
|
68
|
|
|
|
|
185
|
|
|
68
|
|
|
|
|
194
|
|
|
68
|
|
|
|
|
154
|
|
|
68
|
|
|
|
|
95
|
|
|
68
|
|
|
|
|
209
|
|
|
68
|
|
|
|
|
98
|
|
86
|
|
|
|
|
|
|
|
87
|
68
|
|
|
|
|
141
|
my $method_arg = $type_href->{$cli_arg}; |
88
|
|
|
|
|
|
|
|
89
|
68
|
|
|
|
|
124
|
my $is_array = 0; |
90
|
68
|
50
|
|
|
|
214
|
if( $method_arg =~ s/^\@(.+)/$1/ ){ |
91
|
0
|
|
|
|
|
0
|
$is_array = 1; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
68
|
100
|
|
|
|
2076
|
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
|
|
55444
|
Str :$subtype! ) { |
|
18
|
50
|
33
|
18
|
|
44
|
|
|
18
|
50
|
|
18
|
|
1917
|
|
|
18
|
50
|
|
18
|
|
126
|
|
|
18
|
50
|
|
18
|
|
46
|
|
|
18
|
50
|
|
18
|
|
820
|
|
|
18
|
50
|
|
476
|
|
112
|
|
|
18
|
50
|
|
|
|
41
|
|
|
18
|
50
|
|
|
|
85
|
|
|
18
|
|
|
|
|
1464
|
|
|
18
|
|
|
|
|
72
|
|
|
18
|
|
|
|
|
6249
|
|
|
18
|
|
|
|
|
126
|
|
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
2686
|
|
|
18
|
|
|
|
|
121
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
5754
|
|
|
476
|
|
|
|
|
1004
|
|
|
476
|
|
|
|
|
802
|
|
|
476
|
|
|
|
|
620
|
|
|
476
|
|
|
|
|
1212
|
|
|
0
|
|
|
|
|
0
|
|
|
476
|
|
|
|
|
664
|
|
|
476
|
|
|
|
|
756
|
|
|
476
|
|
|
|
|
976
|
|
|
0
|
|
|
|
|
0
|
|
|
476
|
|
|
|
|
928
|
|
|
952
|
|
|
|
|
1344
|
|
|
952
|
|
|
|
|
1669
|
|
|
952
|
|
|
|
|
1865
|
|
|
476
|
|
|
|
|
705
|
|
|
476
|
|
|
|
|
1238
|
|
|
476
|
|
|
|
|
2611
|
|
|
476
|
|
|
|
|
1155
|
|
|
476
|
|
|
|
|
937
|
|
|
476
|
|
|
|
|
631
|
|
|
476
|
|
|
|
|
854
|
|
|
476
|
|
|
|
|
1015
|
|
|
476
|
|
|
|
|
872
|
|
|
476
|
|
|
|
|
589
|
|
|
476
|
|
|
|
|
1223
|
|
|
476
|
|
|
|
|
588
|
|
106
|
|
|
|
|
|
|
|
107
|
476
|
|
|
|
|
723
|
my @ret; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $hard; |
110
|
476
|
100
|
|
|
|
996
|
if ( $subtype eq 'hard' ) { |
|
|
50
|
|
|
|
|
|
111
|
289
|
|
|
|
|
410
|
$hard = 1; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
elsif ( $subtype eq 'soft' ) { |
114
|
187
|
|
|
|
|
293
|
$hard = 0; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
else { |
117
|
0
|
|
|
|
|
0
|
$self->warn("unrecognized required arg subtype: $subtype"); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
476
|
|
|
|
|
715
|
my $subtype_href = $type_href->{$subtype}; |
121
|
|
|
|
|
|
|
|
122
|
476
|
|
|
|
|
1170
|
foreach my $cli_arg ( keys %$subtype_href ) { |
123
|
|
|
|
|
|
|
|
124
|
289
|
|
|
|
|
548
|
my $method_arg = $subtype_href->{$cli_arg}; |
125
|
|
|
|
|
|
|
|
126
|
289
|
|
|
|
|
382
|
my $is_array = 0; |
127
|
289
|
100
|
|
|
|
930
|
if( $method_arg =~ s/^\@(.+)$/$1/ ){ |
128
|
51
|
|
|
|
|
112
|
$is_array = 1; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
289
|
100
|
|
|
|
8927
|
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
|
|
|
|
|
1527
|
return @ret; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# alias for _parse_opt_args |
146
|
18
|
0
|
0
|
18
|
|
44398
|
method _parse_opt_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
45
|
|
|
18
|
0
|
|
18
|
|
1820
|
|
|
18
|
0
|
|
18
|
|
125
|
|
|
18
|
0
|
|
18
|
|
46
|
|
|
18
|
0
|
|
0
|
|
791
|
|
|
18
|
|
|
|
|
114
|
|
|
18
|
|
|
|
|
71
|
|
|
18
|
|
|
|
|
100
|
|
|
18
|
|
|
|
|
1359
|
|
|
18
|
|
|
|
|
53
|
|
|
18
|
|
|
|
|
6192
|
|
|
18
|
|
|
|
|
126
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
2388
|
|
|
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
|
|
43868
|
method _parse_opt_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
40
|
|
|
18
|
50
|
|
18
|
|
1863
|
|
|
18
|
50
|
|
18
|
|
126
|
|
|
18
|
50
|
|
18
|
|
39
|
|
|
18
|
50
|
|
204
|
|
929
|
|
|
18
|
|
|
|
|
112
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
92
|
|
|
18
|
|
|
|
|
1365
|
|
|
18
|
|
|
|
|
68
|
|
|
18
|
|
|
|
|
5950
|
|
|
18
|
|
|
|
|
126
|
|
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
4872
|
|
|
204
|
|
|
|
|
474
|
|
|
204
|
|
|
|
|
373
|
|
|
204
|
|
|
|
|
292
|
|
|
204
|
|
|
|
|
606
|
|
|
0
|
|
|
|
|
0
|
|
|
204
|
|
|
|
|
323
|
|
|
204
|
|
|
|
|
392
|
|
|
204
|
|
|
|
|
548
|
|
|
0
|
|
|
|
|
0
|
|
|
204
|
|
|
|
|
524
|
|
|
204
|
|
|
|
|
466
|
|
|
204
|
|
|
|
|
527
|
|
|
204
|
|
|
|
|
508
|
|
|
204
|
|
|
|
|
305
|
|
|
204
|
|
|
|
|
581
|
|
|
204
|
|
|
|
|
1060
|
|
|
204
|
|
|
|
|
565
|
|
|
204
|
|
|
|
|
468
|
|
|
204
|
|
|
|
|
283
|
|
|
204
|
|
|
|
|
478
|
|
|
204
|
|
|
|
|
255
|
|
152
|
|
|
|
|
|
|
|
153
|
204
|
|
|
|
|
304
|
my @ret; |
154
|
|
|
|
|
|
|
|
155
|
204
|
|
|
|
|
568
|
foreach my $cli_arg ( keys %$type_href ) { |
156
|
|
|
|
|
|
|
|
157
|
221
|
|
|
|
|
432
|
my $method_arg = $type_href->{$cli_arg}; |
158
|
|
|
|
|
|
|
|
159
|
221
|
|
|
|
|
305
|
my $is_array = 0; |
160
|
221
|
100
|
|
|
|
679
|
if( $method_arg =~ s/^\@(.+)$/$1/ ){ |
161
|
34
|
|
|
|
|
73
|
$is_array = 1; |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
221
|
100
|
|
|
|
6560
|
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
|
|
|
|
|
583
|
push @ret, $opt; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
204
|
|
|
|
|
634
|
return @ret; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# alias for _parse_flag_args |
179
|
18
|
0
|
0
|
18
|
|
43635
|
method _parse_flag_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
73
|
|
|
18
|
0
|
|
18
|
|
1984
|
|
|
18
|
0
|
|
18
|
|
136
|
|
|
18
|
0
|
|
18
|
|
42
|
|
|
18
|
0
|
|
0
|
|
823
|
|
|
18
|
|
|
|
|
109
|
|
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
106
|
|
|
18
|
|
|
|
|
1343
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
6026
|
|
|
18
|
|
|
|
|
128
|
|
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
2413
|
|
|
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
|
|
44529
|
method _parse_flag_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
60
|
|
|
18
|
50
|
|
18
|
|
1896
|
|
|
18
|
50
|
|
18
|
|
155
|
|
|
18
|
50
|
|
18
|
|
54
|
|
|
18
|
50
|
|
68
|
|
808
|
|
|
18
|
|
|
|
|
106
|
|
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
104
|
|
|
18
|
|
|
|
|
1288
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
6989
|
|
|
18
|
|
|
|
|
124
|
|
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
3896
|
|
|
68
|
|
|
|
|
210
|
|
|
68
|
|
|
|
|
143
|
|
|
68
|
|
|
|
|
104
|
|
|
68
|
|
|
|
|
288
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
131
|
|
|
68
|
|
|
|
|
185
|
|
|
68
|
|
|
|
|
219
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
197
|
|
|
68
|
|
|
|
|
155
|
|
|
68
|
|
|
|
|
245
|
|
|
68
|
|
|
|
|
235
|
|
|
68
|
|
|
|
|
111
|
|
|
68
|
|
|
|
|
207
|
|
|
68
|
|
|
|
|
391
|
|
|
68
|
|
|
|
|
219
|
|
|
68
|
|
|
|
|
190
|
|
|
68
|
|
|
|
|
94
|
|
|
68
|
|
|
|
|
186
|
|
|
68
|
|
|
|
|
130
|
|
185
|
|
|
|
|
|
|
|
186
|
68
|
|
|
|
|
127
|
my @ret; |
187
|
|
|
|
|
|
|
|
188
|
68
|
|
|
|
|
194
|
foreach my $cli_arg ( keys %$type_href ) { |
189
|
|
|
|
|
|
|
|
190
|
68
|
|
|
|
|
146
|
my $method_arg = $type_href->{$cli_arg}; |
191
|
|
|
|
|
|
|
|
192
|
68
|
100
|
|
|
|
1992
|
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
|
|
|
|
|
227
|
return @ret; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
18
|
50
|
33
|
18
|
|
37666
|
method _parse_attrs (HashRef :$href!) { |
|
18
|
50
|
33
|
18
|
|
53
|
|
|
18
|
50
|
|
18
|
|
2756
|
|
|
18
|
50
|
|
18
|
|
167
|
|
|
18
|
50
|
|
18
|
|
32
|
|
|
18
|
50
|
|
272
|
|
743
|
|
|
18
|
|
|
|
|
102
|
|
|
18
|
|
|
|
|
55
|
|
|
18
|
|
|
|
|
88
|
|
|
18
|
|
|
|
|
1392
|
|
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
6444
|
|
|
18
|
|
|
|
|
124
|
|
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
2810
|
|
|
272
|
|
|
|
|
685
|
|
|
272
|
|
|
|
|
451
|
|
|
272
|
|
|
|
|
381
|
|
|
272
|
|
|
|
|
810
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
429
|
|
|
272
|
|
|
|
|
487
|
|
|
272
|
|
|
|
|
642
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
595
|
|
|
272
|
|
|
|
|
503
|
|
|
272
|
|
|
|
|
701
|
|
|
272
|
|
|
|
|
634
|
|
|
272
|
|
|
|
|
439
|
|
|
272
|
|
|
|
|
711
|
|
|
272
|
|
|
|
|
1260
|
|
|
272
|
|
|
|
|
741
|
|
|
272
|
|
|
|
|
608
|
|
|
272
|
|
|
|
|
405
|
|
|
272
|
|
|
|
|
590
|
|
|
272
|
|
|
|
|
378
|
|
207
|
|
|
|
|
|
|
|
208
|
272
|
100
|
|
|
|
730
|
my $attr_href = defined $href->{attr} ? $href->{attr} : {}; |
209
|
272
|
|
|
|
|
840
|
return $self->__parse_args( args_href => $attr_href ); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
18
|
50
|
33
|
18
|
|
37160
|
method _parse_args (HashRef :$href!) { |
|
18
|
50
|
33
|
18
|
|
70
|
|
|
18
|
50
|
|
18
|
|
2106
|
|
|
18
|
50
|
|
18
|
|
122
|
|
|
18
|
50
|
|
18
|
|
45
|
|
|
18
|
50
|
|
272
|
|
822
|
|
|
18
|
|
|
|
|
118
|
|
|
18
|
|
|
|
|
101
|
|
|
18
|
|
|
|
|
90
|
|
|
18
|
|
|
|
|
1280
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
6146
|
|
|
18
|
|
|
|
|
123
|
|
|
18
|
|
|
|
|
80
|
|
|
18
|
|
|
|
|
2695
|
|
|
272
|
|
|
|
|
778
|
|
|
272
|
|
|
|
|
468
|
|
|
272
|
|
|
|
|
372
|
|
|
272
|
|
|
|
|
882
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
447
|
|
|
272
|
|
|
|
|
491
|
|
|
272
|
|
|
|
|
664
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
617
|
|
|
272
|
|
|
|
|
533
|
|
|
272
|
|
|
|
|
694
|
|
|
272
|
|
|
|
|
680
|
|
|
272
|
|
|
|
|
396
|
|
|
272
|
|
|
|
|
629
|
|
|
272
|
|
|
|
|
1246
|
|
|
272
|
|
|
|
|
720
|
|
|
272
|
|
|
|
|
598
|
|
|
272
|
|
|
|
|
366
|
|
|
272
|
|
|
|
|
573
|
|
|
272
|
|
|
|
|
381
|
|
213
|
|
|
|
|
|
|
|
214
|
272
|
100
|
|
|
|
663
|
my $args_href = defined $href->{args} ? $href->{args} : {}; |
215
|
272
|
|
|
|
|
757
|
return $self->__parse_args( args_href => $args_href ); |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
18
|
50
|
33
|
18
|
|
38959
|
method __parse_args (HashRef :$args_href!) { |
|
18
|
50
|
33
|
18
|
|
41
|
|
|
18
|
50
|
|
18
|
|
1856
|
|
|
18
|
50
|
|
18
|
|
123
|
|
|
18
|
50
|
|
18
|
|
34
|
|
|
18
|
50
|
|
544
|
|
757
|
|
|
18
|
|
|
|
|
115
|
|
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
91
|
|
|
18
|
|
|
|
|
1295
|
|
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
6309
|
|
|
18
|
|
|
|
|
136
|
|
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
7659
|
|
|
544
|
|
|
|
|
1058
|
|
|
544
|
|
|
|
|
780
|
|
|
544
|
|
|
|
|
690
|
|
|
544
|
|
|
|
|
1374
|
|
|
0
|
|
|
|
|
0
|
|
|
544
|
|
|
|
|
722
|
|
|
544
|
|
|
|
|
820
|
|
|
544
|
|
|
|
|
1057
|
|
|
0
|
|
|
|
|
0
|
|
|
544
|
|
|
|
|
1027
|
|
|
544
|
|
|
|
|
839
|
|
|
544
|
|
|
|
|
1123
|
|
|
544
|
|
|
|
|
1201
|
|
|
544
|
|
|
|
|
791
|
|
|
544
|
|
|
|
|
1098
|
|
|
544
|
|
|
|
|
2062
|
|
|
544
|
|
|
|
|
1223
|
|
|
544
|
|
|
|
|
1059
|
|
|
544
|
|
|
|
|
676
|
|
|
544
|
|
|
|
|
952
|
|
|
544
|
|
|
|
|
696
|
|
219
|
|
|
|
|
|
|
|
220
|
544
|
|
|
|
|
793
|
my @args; |
221
|
|
|
|
|
|
|
|
222
|
544
|
|
|
|
|
1391
|
foreach my $type ( keys %$args_href ) { |
223
|
|
|
|
|
|
|
|
224
|
969
|
|
|
|
|
1449
|
my $type_href = $args_href->{$type}; |
225
|
|
|
|
|
|
|
|
226
|
969
|
100
|
|
|
|
1730
|
if ( defined $type_href ) { |
227
|
629
|
100
|
|
|
|
2501
|
if ( $type =~ /^opt/ ) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
228
|
204
|
|
|
|
|
687
|
my @opt = $self->_parse_opt_args( type_href => $type_href ); |
229
|
204
|
|
|
|
|
449
|
push @args, @opt; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
elsif ( $type =~ /^req/ ) { |
232
|
357
|
|
|
|
|
1063
|
my @req = $self->_parse_req_args( type_href => $type_href ); |
233
|
357
|
|
|
|
|
829
|
push @args, @req; |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
elsif ( $type =~ /^flag/ ) { |
236
|
68
|
|
|
|
|
303
|
my @flag = $self->_parse_flag_args( type_href => $type_href ); |
237
|
68
|
|
|
|
|
172
|
push @args, @flag; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
else { |
240
|
0
|
|
|
|
|
0
|
$self->warn("unrecognized type: $type"); |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
544
|
|
|
|
|
2044
|
return \@args; |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
1; |
249
|
|
|
|
|
|
|
|