line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Driver::ArgParserRole; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
16664
|
use Modern::Perl; |
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
181
|
|
4
|
18
|
|
|
18
|
|
3181
|
use Moose::Role; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
173
|
|
5
|
18
|
|
|
18
|
|
102329
|
use namespace::autoclean; |
|
18
|
|
|
|
|
58
|
|
|
18
|
|
|
|
|
193
|
|
6
|
18
|
|
|
18
|
|
1618
|
use Kavorka '-all'; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
180
|
|
7
|
18
|
|
|
18
|
|
72230
|
use Data::Printer alias => 'pdump'; |
|
18
|
|
|
|
|
42
|
|
|
18
|
|
|
|
|
231
|
|
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
|
|
55581
|
method _parse_req_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
63
|
|
|
18
|
0
|
|
18
|
|
2232
|
|
|
18
|
0
|
|
18
|
|
129
|
|
|
18
|
0
|
|
18
|
|
47
|
|
|
18
|
0
|
|
0
|
|
892
|
|
|
18
|
|
|
|
|
120
|
|
|
18
|
|
|
|
|
50
|
|
|
18
|
|
|
|
|
148
|
|
|
18
|
|
|
|
|
1803
|
|
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
6987
|
|
|
18
|
|
|
|
|
138
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
2689
|
|
|
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
|
|
49199
|
method _parse_req_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
63
|
|
|
18
|
50
|
|
18
|
|
2351
|
|
|
18
|
50
|
|
18
|
|
170
|
|
|
18
|
50
|
|
18
|
|
59
|
|
|
18
|
50
|
|
357
|
|
967
|
|
|
18
|
|
|
|
|
141
|
|
|
18
|
|
|
|
|
68
|
|
|
18
|
|
|
|
|
116
|
|
|
18
|
|
|
|
|
1478
|
|
|
18
|
|
|
|
|
76
|
|
|
18
|
|
|
|
|
7097
|
|
|
18
|
|
|
|
|
160
|
|
|
18
|
|
|
|
|
50
|
|
|
18
|
|
|
|
|
4849
|
|
|
357
|
|
|
|
|
862
|
|
|
357
|
|
|
|
|
605
|
|
|
357
|
|
|
|
|
512
|
|
|
357
|
|
|
|
|
1058
|
|
|
0
|
|
|
|
|
0
|
|
|
357
|
|
|
|
|
517
|
|
|
357
|
|
|
|
|
693
|
|
|
357
|
|
|
|
|
969
|
|
|
0
|
|
|
|
|
0
|
|
|
357
|
|
|
|
|
813
|
|
|
357
|
|
|
|
|
654
|
|
|
357
|
|
|
|
|
854
|
|
|
357
|
|
|
|
|
884
|
|
|
357
|
|
|
|
|
569
|
|
|
357
|
|
|
|
|
955
|
|
|
357
|
|
|
|
|
1687
|
|
|
357
|
|
|
|
|
955
|
|
|
357
|
|
|
|
|
871
|
|
|
357
|
|
|
|
|
500
|
|
|
357
|
|
|
|
|
733
|
|
|
357
|
|
|
|
|
501
|
|
60
|
|
|
|
|
|
|
|
61
|
357
|
|
|
|
|
542
|
my @ret; |
62
|
|
|
|
|
|
|
|
63
|
357
|
|
|
|
|
1206
|
foreach my $cli_arg ( keys %$type_href ) { |
64
|
|
|
|
|
|
|
|
65
|
544
|
100
|
100
|
|
|
1787
|
if ( $cli_arg eq 'hard' or $cli_arg eq 'soft' ) { |
66
|
476
|
|
|
|
|
1337
|
push @ret, |
67
|
|
|
|
|
|
|
$self->_parse_req_args_v1( |
68
|
|
|
|
|
|
|
type_href => $type_href, |
69
|
|
|
|
|
|
|
subtype => $cli_arg |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
else { |
73
|
68
|
|
|
|
|
276
|
push @ret, |
74
|
|
|
|
|
|
|
$self->_parse_req_args_v2( |
75
|
|
|
|
|
|
|
type_href => $type_href, |
76
|
|
|
|
|
|
|
cli_arg => $cli_arg |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
357
|
|
|
|
|
1053
|
return @ret; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
method _parse_req_args_v2 (HashRef :$type_href!, |
85
|
18
|
50
|
33
|
18
|
|
61095
|
Str :$cli_arg! ) { |
|
18
|
50
|
33
|
18
|
|
48
|
|
|
18
|
50
|
|
18
|
|
2405
|
|
|
18
|
50
|
|
18
|
|
144
|
|
|
18
|
50
|
|
18
|
|
56
|
|
|
18
|
50
|
|
18
|
|
827
|
|
|
18
|
50
|
|
68
|
|
117
|
|
|
18
|
50
|
|
|
|
58
|
|
|
18
|
50
|
|
|
|
138
|
|
|
18
|
|
|
|
|
1561
|
|
|
18
|
|
|
|
|
60
|
|
|
18
|
|
|
|
|
6936
|
|
|
18
|
|
|
|
|
137
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
3178
|
|
|
18
|
|
|
|
|
167
|
|
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
3981
|
|
|
68
|
|
|
|
|
237
|
|
|
68
|
|
|
|
|
165
|
|
|
68
|
|
|
|
|
116
|
|
|
68
|
|
|
|
|
251
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
113
|
|
|
68
|
|
|
|
|
152
|
|
|
68
|
|
|
|
|
204
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
222
|
|
|
136
|
|
|
|
|
240
|
|
|
136
|
|
|
|
|
322
|
|
|
136
|
|
|
|
|
310
|
|
|
68
|
|
|
|
|
125
|
|
|
68
|
|
|
|
|
264
|
|
|
68
|
|
|
|
|
489
|
|
|
68
|
|
|
|
|
241
|
|
|
68
|
|
|
|
|
206
|
|
|
68
|
|
|
|
|
107
|
|
|
68
|
|
|
|
|
191
|
|
|
68
|
|
|
|
|
196
|
|
|
68
|
|
|
|
|
181
|
|
|
68
|
|
|
|
|
104
|
|
|
68
|
|
|
|
|
279
|
|
|
68
|
|
|
|
|
112
|
|
86
|
|
|
|
|
|
|
|
87
|
68
|
|
|
|
|
137
|
my $method_arg = $type_href->{$cli_arg}; |
88
|
|
|
|
|
|
|
|
89
|
68
|
|
|
|
|
118
|
my $is_array = 0; |
90
|
68
|
50
|
|
|
|
223
|
if( $method_arg =~ s/^\@(.+)/$1/ ){ |
91
|
0
|
|
|
|
|
0
|
$is_array = 1; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
68
|
100
|
|
|
|
2426
|
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
|
|
61799
|
Str :$subtype! ) { |
|
18
|
50
|
33
|
18
|
|
48
|
|
|
18
|
50
|
|
18
|
|
2149
|
|
|
18
|
50
|
|
18
|
|
136
|
|
|
18
|
50
|
|
18
|
|
44
|
|
|
18
|
50
|
|
18
|
|
884
|
|
|
18
|
50
|
|
476
|
|
133
|
|
|
18
|
50
|
|
|
|
56
|
|
|
18
|
50
|
|
|
|
99
|
|
|
18
|
|
|
|
|
1688
|
|
|
18
|
|
|
|
|
59
|
|
|
18
|
|
|
|
|
6912
|
|
|
18
|
|
|
|
|
145
|
|
|
18
|
|
|
|
|
48
|
|
|
18
|
|
|
|
|
3133
|
|
|
18
|
|
|
|
|
142
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
6552
|
|
|
476
|
|
|
|
|
1060
|
|
|
476
|
|
|
|
|
786
|
|
|
476
|
|
|
|
|
669
|
|
|
476
|
|
|
|
|
1336
|
|
|
0
|
|
|
|
|
0
|
|
|
476
|
|
|
|
|
689
|
|
|
476
|
|
|
|
|
859
|
|
|
476
|
|
|
|
|
1051
|
|
|
0
|
|
|
|
|
0
|
|
|
476
|
|
|
|
|
1083
|
|
|
952
|
|
|
|
|
1450
|
|
|
952
|
|
|
|
|
1822
|
|
|
952
|
|
|
|
|
1934
|
|
|
476
|
|
|
|
|
698
|
|
|
476
|
|
|
|
|
1344
|
|
|
476
|
|
|
|
|
2855
|
|
|
476
|
|
|
|
|
1263
|
|
|
476
|
|
|
|
|
1012
|
|
|
476
|
|
|
|
|
667
|
|
|
476
|
|
|
|
|
921
|
|
|
476
|
|
|
|
|
1018
|
|
|
476
|
|
|
|
|
909
|
|
|
476
|
|
|
|
|
726
|
|
|
476
|
|
|
|
|
1308
|
|
|
476
|
|
|
|
|
638
|
|
106
|
|
|
|
|
|
|
|
107
|
476
|
|
|
|
|
786
|
my @ret; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $hard; |
110
|
476
|
100
|
|
|
|
1051
|
if ( $subtype eq 'hard' ) { |
|
|
50
|
|
|
|
|
|
111
|
289
|
|
|
|
|
457
|
$hard = 1; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
elsif ( $subtype eq 'soft' ) { |
114
|
187
|
|
|
|
|
319
|
$hard = 0; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
else { |
117
|
0
|
|
|
|
|
0
|
$self->warn("unrecognized required arg subtype: $subtype"); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
476
|
|
|
|
|
760
|
my $subtype_href = $type_href->{$subtype}; |
121
|
|
|
|
|
|
|
|
122
|
476
|
|
|
|
|
1386
|
foreach my $cli_arg ( keys %$subtype_href ) { |
123
|
|
|
|
|
|
|
|
124
|
289
|
|
|
|
|
560
|
my $method_arg = $subtype_href->{$cli_arg}; |
125
|
|
|
|
|
|
|
|
126
|
289
|
|
|
|
|
451
|
my $is_array = 0; |
127
|
289
|
100
|
|
|
|
1098
|
if( $method_arg =~ s/^\@(.+)$/$1/ ){ |
128
|
51
|
|
|
|
|
167
|
$is_array = 1; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
289
|
100
|
|
|
|
9611
|
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
|
|
|
|
|
1610
|
return @ret; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# alias for _parse_opt_args |
146
|
18
|
0
|
0
|
18
|
|
49490
|
method _parse_opt_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
43
|
|
|
18
|
0
|
|
18
|
|
2118
|
|
|
18
|
0
|
|
18
|
|
150
|
|
|
18
|
0
|
|
18
|
|
46
|
|
|
18
|
0
|
|
0
|
|
981
|
|
|
18
|
|
|
|
|
112
|
|
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
141
|
|
|
18
|
|
|
|
|
1465
|
|
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
7013
|
|
|
18
|
|
|
|
|
173
|
|
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
2734
|
|
|
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
|
|
49460
|
method _parse_opt_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
47
|
|
|
18
|
50
|
|
18
|
|
2127
|
|
|
18
|
50
|
|
18
|
|
134
|
|
|
18
|
50
|
|
18
|
|
43
|
|
|
18
|
50
|
|
204
|
|
1156
|
|
|
18
|
|
|
|
|
138
|
|
|
18
|
|
|
|
|
38
|
|
|
18
|
|
|
|
|
118
|
|
|
18
|
|
|
|
|
1618
|
|
|
18
|
|
|
|
|
71
|
|
|
18
|
|
|
|
|
6696
|
|
|
18
|
|
|
|
|
145
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
5464
|
|
|
204
|
|
|
|
|
572
|
|
|
204
|
|
|
|
|
426
|
|
|
204
|
|
|
|
|
660
|
|
|
204
|
|
|
|
|
733
|
|
|
0
|
|
|
|
|
0
|
|
|
204
|
|
|
|
|
329
|
|
|
204
|
|
|
|
|
403
|
|
|
204
|
|
|
|
|
512
|
|
|
0
|
|
|
|
|
0
|
|
|
204
|
|
|
|
|
505
|
|
|
204
|
|
|
|
|
430
|
|
|
204
|
|
|
|
|
543
|
|
|
204
|
|
|
|
|
517
|
|
|
204
|
|
|
|
|
314
|
|
|
204
|
|
|
|
|
531
|
|
|
204
|
|
|
|
|
1088
|
|
|
204
|
|
|
|
|
627
|
|
|
204
|
|
|
|
|
515
|
|
|
204
|
|
|
|
|
320
|
|
|
204
|
|
|
|
|
471
|
|
|
204
|
|
|
|
|
318
|
|
152
|
|
|
|
|
|
|
|
153
|
204
|
|
|
|
|
331
|
my @ret; |
154
|
|
|
|
|
|
|
|
155
|
204
|
|
|
|
|
598
|
foreach my $cli_arg ( keys %$type_href ) { |
156
|
|
|
|
|
|
|
|
157
|
221
|
|
|
|
|
432
|
my $method_arg = $type_href->{$cli_arg}; |
158
|
|
|
|
|
|
|
|
159
|
221
|
|
|
|
|
347
|
my $is_array = 0; |
160
|
221
|
100
|
|
|
|
739
|
if( $method_arg =~ s/^\@(.+)$/$1/ ){ |
161
|
34
|
|
|
|
|
87
|
$is_array = 1; |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
221
|
100
|
|
|
|
7010
|
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
|
|
|
|
|
636
|
push @ret, $opt; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
204
|
|
|
|
|
704
|
return @ret; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# alias for _parse_flag_args |
179
|
18
|
0
|
0
|
18
|
|
50174
|
method _parse_flag_attrs (HashRef :$type_href) { |
|
18
|
0
|
0
|
18
|
|
57
|
|
|
18
|
0
|
|
18
|
|
2298
|
|
|
18
|
0
|
|
18
|
|
146
|
|
|
18
|
0
|
|
18
|
|
48
|
|
|
18
|
0
|
|
0
|
|
941
|
|
|
18
|
|
|
|
|
137
|
|
|
18
|
|
|
|
|
56
|
|
|
18
|
|
|
|
|
104
|
|
|
18
|
|
|
|
|
1532
|
|
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
6610
|
|
|
18
|
|
|
|
|
139
|
|
|
18
|
|
|
|
|
55
|
|
|
18
|
|
|
|
|
2669
|
|
|
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
|
|
50407
|
method _parse_flag_args (HashRef :$type_href) { |
|
18
|
50
|
33
|
18
|
|
87
|
|
|
18
|
50
|
|
18
|
|
2295
|
|
|
18
|
50
|
|
18
|
|
146
|
|
|
18
|
50
|
|
18
|
|
45
|
|
|
18
|
50
|
|
68
|
|
859
|
|
|
18
|
|
|
|
|
117
|
|
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
107
|
|
|
18
|
|
|
|
|
1466
|
|
|
18
|
|
|
|
|
59
|
|
|
18
|
|
|
|
|
7972
|
|
|
18
|
|
|
|
|
138
|
|
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
4224
|
|
|
68
|
|
|
|
|
233
|
|
|
68
|
|
|
|
|
159
|
|
|
68
|
|
|
|
|
140
|
|
|
68
|
|
|
|
|
306
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
136
|
|
|
68
|
|
|
|
|
151
|
|
|
68
|
|
|
|
|
209
|
|
|
0
|
|
|
|
|
0
|
|
|
68
|
|
|
|
|
214
|
|
|
68
|
|
|
|
|
181
|
|
|
68
|
|
|
|
|
209
|
|
|
68
|
|
|
|
|
239
|
|
|
68
|
|
|
|
|
119
|
|
|
68
|
|
|
|
|
210
|
|
|
68
|
|
|
|
|
411
|
|
|
68
|
|
|
|
|
232
|
|
|
68
|
|
|
|
|
193
|
|
|
68
|
|
|
|
|
133
|
|
|
68
|
|
|
|
|
192
|
|
|
68
|
|
|
|
|
171
|
|
185
|
|
|
|
|
|
|
|
186
|
68
|
|
|
|
|
134
|
my @ret; |
187
|
|
|
|
|
|
|
|
188
|
68
|
|
|
|
|
221
|
foreach my $cli_arg ( keys %$type_href ) { |
189
|
|
|
|
|
|
|
|
190
|
68
|
|
|
|
|
143
|
my $method_arg = $type_href->{$cli_arg}; |
191
|
|
|
|
|
|
|
|
192
|
68
|
100
|
|
|
|
2221
|
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
|
|
|
|
|
231
|
push @ret, $opt; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
|
203
|
68
|
|
|
|
|
256
|
return @ret; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
18
|
50
|
33
|
18
|
|
42047
|
method _parse_attrs (HashRef :$href!) { |
|
18
|
50
|
33
|
18
|
|
44
|
|
|
18
|
50
|
|
18
|
|
3211
|
|
|
18
|
50
|
|
18
|
|
187
|
|
|
18
|
50
|
|
18
|
|
37
|
|
|
18
|
50
|
|
272
|
|
1188
|
|
|
18
|
|
|
|
|
121
|
|
|
18
|
|
|
|
|
66
|
|
|
18
|
|
|
|
|
130
|
|
|
18
|
|
|
|
|
1624
|
|
|
18
|
|
|
|
|
51
|
|
|
18
|
|
|
|
|
7006
|
|
|
18
|
|
|
|
|
153
|
|
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
3249
|
|
|
272
|
|
|
|
|
783
|
|
|
272
|
|
|
|
|
481
|
|
|
272
|
|
|
|
|
488
|
|
|
272
|
|
|
|
|
942
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
481
|
|
|
272
|
|
|
|
|
519
|
|
|
272
|
|
|
|
|
697
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
741
|
|
|
272
|
|
|
|
|
538
|
|
|
272
|
|
|
|
|
794
|
|
|
272
|
|
|
|
|
779
|
|
|
272
|
|
|
|
|
435
|
|
|
272
|
|
|
|
|
741
|
|
|
272
|
|
|
|
|
1335
|
|
|
272
|
|
|
|
|
806
|
|
|
272
|
|
|
|
|
651
|
|
|
272
|
|
|
|
|
436
|
|
|
272
|
|
|
|
|
696
|
|
|
272
|
|
|
|
|
444
|
|
207
|
|
|
|
|
|
|
|
208
|
272
|
100
|
|
|
|
821
|
my $attr_href = defined $href->{attr} ? $href->{attr} : {}; |
209
|
272
|
|
|
|
|
864
|
return $self->__parse_args( args_href => $attr_href ); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
18
|
50
|
33
|
18
|
|
41982
|
method _parse_args (HashRef :$href!) { |
|
18
|
50
|
33
|
18
|
|
59
|
|
|
18
|
50
|
|
18
|
|
2452
|
|
|
18
|
50
|
|
18
|
|
143
|
|
|
18
|
50
|
|
18
|
|
51
|
|
|
18
|
50
|
|
272
|
|
886
|
|
|
18
|
|
|
|
|
116
|
|
|
18
|
|
|
|
|
95
|
|
|
18
|
|
|
|
|
107
|
|
|
18
|
|
|
|
|
1474
|
|
|
18
|
|
|
|
|
53
|
|
|
18
|
|
|
|
|
7147
|
|
|
18
|
|
|
|
|
136
|
|
|
18
|
|
|
|
|
107
|
|
|
18
|
|
|
|
|
3113
|
|
|
272
|
|
|
|
|
779
|
|
|
272
|
|
|
|
|
489
|
|
|
272
|
|
|
|
|
436
|
|
|
272
|
|
|
|
|
846
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
463
|
|
|
272
|
|
|
|
|
536
|
|
|
272
|
|
|
|
|
685
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
705
|
|
|
272
|
|
|
|
|
524
|
|
|
272
|
|
|
|
|
774
|
|
|
272
|
|
|
|
|
724
|
|
|
272
|
|
|
|
|
431
|
|
|
272
|
|
|
|
|
746
|
|
|
272
|
|
|
|
|
1359
|
|
|
272
|
|
|
|
|
852
|
|
|
272
|
|
|
|
|
632
|
|
|
272
|
|
|
|
|
394
|
|
|
272
|
|
|
|
|
614
|
|
|
272
|
|
|
|
|
409
|
|
213
|
|
|
|
|
|
|
|
214
|
272
|
100
|
|
|
|
709
|
my $args_href = defined $href->{args} ? $href->{args} : {}; |
215
|
272
|
|
|
|
|
827
|
return $self->__parse_args( args_href => $args_href ); |
216
|
|
|
|
|
|
|
} |
217
|
|
|
|
|
|
|
|
218
|
18
|
50
|
33
|
18
|
|
43772
|
method __parse_args (HashRef :$args_href!) { |
|
18
|
50
|
33
|
18
|
|
50
|
|
|
18
|
50
|
|
18
|
|
2178
|
|
|
18
|
50
|
|
18
|
|
135
|
|
|
18
|
50
|
|
18
|
|
40
|
|
|
18
|
50
|
|
544
|
|
884
|
|
|
18
|
|
|
|
|
112
|
|
|
18
|
|
|
|
|
70
|
|
|
18
|
|
|
|
|
149
|
|
|
18
|
|
|
|
|
1526
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
7197
|
|
|
18
|
|
|
|
|
154
|
|
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
8470
|
|
|
544
|
|
|
|
|
1243
|
|
|
544
|
|
|
|
|
930
|
|
|
544
|
|
|
|
|
778
|
|
|
544
|
|
|
|
|
1467
|
|
|
0
|
|
|
|
|
0
|
|
|
544
|
|
|
|
|
889
|
|
|
544
|
|
|
|
|
920
|
|
|
544
|
|
|
|
|
1144
|
|
|
0
|
|
|
|
|
0
|
|
|
544
|
|
|
|
|
1120
|
|
|
544
|
|
|
|
|
925
|
|
|
544
|
|
|
|
|
1199
|
|
|
544
|
|
|
|
|
1246
|
|
|
544
|
|
|
|
|
793
|
|
|
544
|
|
|
|
|
1290
|
|
|
544
|
|
|
|
|
2184
|
|
|
544
|
|
|
|
|
1327
|
|
|
544
|
|
|
|
|
1088
|
|
|
544
|
|
|
|
|
752
|
|
|
544
|
|
|
|
|
1041
|
|
|
544
|
|
|
|
|
747
|
|
219
|
|
|
|
|
|
|
|
220
|
544
|
|
|
|
|
801
|
my @args; |
221
|
|
|
|
|
|
|
|
222
|
544
|
|
|
|
|
1566
|
foreach my $type ( keys %$args_href ) { |
223
|
|
|
|
|
|
|
|
224
|
969
|
|
|
|
|
1582
|
my $type_href = $args_href->{$type}; |
225
|
|
|
|
|
|
|
|
226
|
969
|
100
|
|
|
|
1882
|
if ( defined $type_href ) { |
227
|
629
|
100
|
|
|
|
2671
|
if ( $type =~ /^opt/ ) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
228
|
204
|
|
|
|
|
758
|
my @opt = $self->_parse_opt_args( type_href => $type_href ); |
229
|
204
|
|
|
|
|
482
|
push @args, @opt; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
elsif ( $type =~ /^req/ ) { |
232
|
357
|
|
|
|
|
1208
|
my @req = $self->_parse_req_args( type_href => $type_href ); |
233
|
357
|
|
|
|
|
880
|
push @args, @req; |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
elsif ( $type =~ /^flag/ ) { |
236
|
68
|
|
|
|
|
310
|
my @flag = $self->_parse_flag_args( type_href => $type_href ); |
237
|
68
|
|
|
|
|
170
|
push @args, @flag; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
else { |
240
|
0
|
|
|
|
|
0
|
$self->warn("unrecognized type: $type"); |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
544
|
|
|
|
|
2264
|
return \@args; |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
1; |
249
|
|
|
|
|
|
|
|