| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Venus::Args; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
21
|
use 5.018; |
|
|
1
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
22
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
28
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use Venus::Class 'attr', 'base', 'with'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
6
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
base 'Venus::Kind::Utility'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Venus::Role::Valuable'; |
|
13
|
|
|
|
|
|
|
with 'Venus::Role::Buildable'; |
|
14
|
|
|
|
|
|
|
with 'Venus::Role::Accessible'; |
|
15
|
|
|
|
|
|
|
with 'Venus::Role::Proxyable'; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# ATTRIBUTES |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
attr 'named'; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# BUILDERS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub build_proxy { |
|
24
|
2
|
|
|
2
|
0
|
7
|
my ($self, $package, $method, $value) = @_; |
|
25
|
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
6
|
my $has_value = exists $_[3]; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return sub { |
|
29
|
2
|
50
|
|
2
|
|
10
|
return $self->get($method) if !$has_value; # no value |
|
30
|
0
|
|
|
|
|
0
|
return $self->set($method, $value); |
|
31
|
2
|
|
|
|
|
11
|
}; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub build_self { |
|
35
|
15
|
|
|
15
|
0
|
24
|
my ($self, $data) = @_; |
|
36
|
|
|
|
|
|
|
|
|
37
|
15
|
50
|
|
|
|
40
|
$self->named({}) if !$self->named; |
|
38
|
|
|
|
|
|
|
|
|
39
|
15
|
|
|
|
|
27
|
return $self; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# METHODS |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub assertion { |
|
45
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
|
46
|
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
0
|
my $assertion = $self->SUPER::assertion; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$assertion->match('arrayref')->format(sub{ |
|
50
|
0
|
|
0
|
0
|
|
0
|
(ref $self || $self)->new($_) |
|
51
|
0
|
|
|
|
|
0
|
}); |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
0
|
return $assertion; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub default { |
|
57
|
1
|
|
|
1
|
1
|
4
|
my ($self) = @_; |
|
58
|
|
|
|
|
|
|
|
|
59
|
1
|
|
|
|
|
5
|
return [@ARGV]; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub exists { |
|
63
|
3
|
|
|
3
|
1
|
15
|
my ($self, $name) = @_; |
|
64
|
|
|
|
|
|
|
|
|
65
|
3
|
50
|
|
|
|
9
|
return if not defined $name; |
|
66
|
|
|
|
|
|
|
|
|
67
|
3
|
|
|
|
|
9
|
my $pos = $self->name($name); |
|
68
|
|
|
|
|
|
|
|
|
69
|
3
|
100
|
|
|
|
11
|
return if not defined $pos; |
|
70
|
|
|
|
|
|
|
|
|
71
|
2
|
|
|
|
|
6
|
return CORE::exists $self->indexed->{$pos}; |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub get { |
|
75
|
5
|
|
|
5
|
1
|
14
|
my ($self, $name) = @_; |
|
76
|
|
|
|
|
|
|
|
|
77
|
5
|
50
|
|
|
|
12
|
return if not defined $name; |
|
78
|
|
|
|
|
|
|
|
|
79
|
5
|
|
|
|
|
13
|
my $pos = $self->name($name); |
|
80
|
|
|
|
|
|
|
|
|
81
|
5
|
100
|
|
|
|
18
|
return if not defined $pos; |
|
82
|
|
|
|
|
|
|
|
|
83
|
4
|
|
|
|
|
12
|
return $self->indexed->{$pos}; |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub indexed { |
|
87
|
15
|
|
|
15
|
1
|
24
|
my ($self) = @_; |
|
88
|
|
|
|
|
|
|
|
|
89
|
15
|
|
|
|
|
22
|
return {map +($_, $self->value->[$_]), 0..$#{$self->value}}; |
|
|
15
|
|
|
|
|
30
|
|
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub name { |
|
93
|
12
|
|
|
12
|
1
|
25
|
my ($self, $name) = @_; |
|
94
|
|
|
|
|
|
|
|
|
95
|
12
|
100
|
|
|
|
29
|
if (defined $self->named->{$name}) { |
|
96
|
6
|
|
|
|
|
22
|
return $self->named->{$name}; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
6
|
100
|
|
|
|
17
|
if (defined $self->indexed->{$name}) { |
|
100
|
3
|
|
|
|
|
13
|
return $name; |
|
101
|
|
|
|
|
|
|
} |
|
102
|
|
|
|
|
|
|
|
|
103
|
3
|
|
|
|
|
9
|
return undef; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub set { |
|
107
|
3
|
|
|
3
|
1
|
13
|
my ($self, $name, $data) = @_; |
|
108
|
|
|
|
|
|
|
|
|
109
|
3
|
50
|
|
|
|
11
|
return if not defined $name; |
|
110
|
|
|
|
|
|
|
|
|
111
|
3
|
|
|
|
|
11
|
my $pos = $self->name($name); |
|
112
|
|
|
|
|
|
|
|
|
113
|
3
|
100
|
|
|
|
13
|
return if not defined $pos; |
|
114
|
|
|
|
|
|
|
|
|
115
|
2
|
|
|
|
|
6
|
return $self->value->[$pos] = $data; |
|
116
|
|
|
|
|
|
|
} |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub unnamed { |
|
119
|
2
|
|
|
2
|
1
|
6
|
my ($self) = @_; |
|
120
|
|
|
|
|
|
|
|
|
121
|
2
|
|
|
|
|
4
|
my $list = []; |
|
122
|
|
|
|
|
|
|
|
|
123
|
2
|
|
|
|
|
4
|
my $argv = $self->indexed; |
|
124
|
2
|
|
|
|
|
4
|
my $data = +{reverse %{$self->named}}; |
|
|
2
|
|
|
|
|
5
|
|
|
125
|
|
|
|
|
|
|
|
|
126
|
2
|
|
|
|
|
15
|
for my $index (sort keys %$argv) { |
|
127
|
8
|
100
|
|
|
|
20
|
unless (exists $data->{$index}) { |
|
128
|
5
|
|
|
|
|
9
|
push @$list, $argv->{$index}; |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
2
|
|
|
|
|
14
|
return $list; |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
1; |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 NAME |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Venus::Args - Args Class |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=cut |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 ABSTRACT |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Args Class for Perl 5 |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=cut |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
package main; |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
use Venus::Args; |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
my $args = Venus::Args->new( |
|
158
|
|
|
|
|
|
|
named => { flag => 0, command => 1 }, # optional |
|
159
|
|
|
|
|
|
|
value => ['--help', 'execute'], |
|
160
|
|
|
|
|
|
|
); |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# $args->flag; # $ARGV[0] |
|
163
|
|
|
|
|
|
|
# $args->get(0); # $ARGV[0] |
|
164
|
|
|
|
|
|
|
# $args->get(1); # $ARGV[1] |
|
165
|
|
|
|
|
|
|
# $args->action; # $ARGV[1] |
|
166
|
|
|
|
|
|
|
# $args->exists(0); # exists $ARGV[0] |
|
167
|
|
|
|
|
|
|
# $args->exists('flag'); # exists $ARGV[0] |
|
168
|
|
|
|
|
|
|
# $args->get('flag'); # $ARGV[0] |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
This package provides methods for accessing C<@ARGS> items. |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=cut |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
This package has the following attributes: |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=cut |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head2 named |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
named(HashRef) |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
This attribute is read-write, accepts C<(HashRef)> values, is optional, and defaults to C<{}>. |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head1 INHERITS |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
This package inherits behaviors from: |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
L |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=cut |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=head1 INTEGRATES |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
This package integrates behaviors from: |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
L |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
L |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
L |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
L |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=cut |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=head1 METHODS |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
This package provides the following methods: |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=cut |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=head2 default |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
default() (arrayref) |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
The default method returns the default value, i.e. C<@ARGV>. |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
I> |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=over 4 |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=item default example 1 |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
# given: synopsis; |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
my $default = $args->default; |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
# [@ARGV] |
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# ["--help", "execute"] |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=back |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=cut |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=head2 exists |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
exists(string $key) (boolean) |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
The exists method returns truthy or falsy if an index or alias value exists. |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
I> |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=over 4 |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=item exists example 1 |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
# given: synopsis; |
|
257
|
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
my $exists = $args->exists(0); |
|
259
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
# 1 |
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=back |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=over 4 |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=item exists example 2 |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
# given: synopsis; |
|
269
|
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
my $exists = $args->exists('flag'); |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# 1 |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=back |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=over 4 |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=item exists example 3 |
|
279
|
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
# given: synopsis; |
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
my $exists = $args->exists(2); |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
# undef |
|
285
|
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=back |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=cut |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=head2 get |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
get(string $key) (any) |
|
293
|
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
The get method returns the value of the index or alias. |
|
295
|
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
I> |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
=over 4 |
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
=item get example 1 |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
# given: synopsis; |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
my $get = $args->get(0); |
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
# "--help" |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=back |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=over 4 |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
=item get example 2 |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
# given: synopsis; |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
my $get = $args->get('flag'); |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
# "--help" |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=back |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
=over 4 |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=item get example 3 |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# given: synopsis; |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
my $get = $args->get(2); |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
# undef |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=back |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=cut |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=head2 indexed |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
indexed() (hashref) |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
The indexed method returns a set of indices and values. |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
I> |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
=over 4 |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=item indexed example 1 |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
# given: synopsis; |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
my $indexed = $args->indexed; |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
# { "0" => "--help", "1" => "execute" } |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=back |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
=cut |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=head2 name |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
name(string $key) (string | undef) |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
The name method resolves and returns the index for an index or alias, and |
|
363
|
|
|
|
|
|
|
returns undefined if not found. |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
I> |
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=over 4 |
|
368
|
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=item name example 1 |
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
# given: synopsis; |
|
372
|
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
my $name = $args->name('flag'); |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=back |
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=cut |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=head2 set |
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
set(string $key, any $data) (any) |
|
382
|
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
The set method sets and returns the value of an index or alias. |
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
I> |
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=over 4 |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
=item set example 1 |
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
# given: synopsis; |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
my $set = $args->set(0, '-?'); |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
# "-?" |
|
396
|
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=back |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=over 4 |
|
400
|
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=item set example 2 |
|
402
|
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
# given: synopsis; |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
my $set = $args->set('flag', '-?'); |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
# "-?" |
|
408
|
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=back |
|
410
|
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=over 4 |
|
412
|
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=item set example 3 |
|
414
|
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
# given: synopsis; |
|
416
|
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
my $set = $args->set('verbose', 1); |
|
418
|
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
# undef |
|
420
|
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=back |
|
422
|
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=cut |
|
424
|
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
=head2 unnamed |
|
426
|
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
unnamed() (arrayref) |
|
428
|
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
The unnamed method returns a list of unaliases indices. |
|
430
|
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
I> |
|
432
|
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=over 4 |
|
434
|
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
=item unnamed example 1 |
|
436
|
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
package main; |
|
438
|
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
use Venus::Args; |
|
440
|
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
my $args = Venus::Args->new( |
|
442
|
|
|
|
|
|
|
named => { flag => 0, command => 1 }, |
|
443
|
|
|
|
|
|
|
value => ['--help', 'execute', '--format', 'markdown'], |
|
444
|
|
|
|
|
|
|
); |
|
445
|
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
my $unnamed = $args->unnamed; |
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
# ["--format", "markdown"] |
|
449
|
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
=back |
|
451
|
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=over 4 |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
=item unnamed example 2 |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
package main; |
|
457
|
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
use Venus::Args; |
|
459
|
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
my $args = Venus::Args->new( |
|
461
|
|
|
|
|
|
|
named => { command => 1 }, |
|
462
|
|
|
|
|
|
|
value => ['execute', 'phase-1', '--format', 'markdown'], |
|
463
|
|
|
|
|
|
|
); |
|
464
|
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
my $unnamed = $args->unnamed; |
|
466
|
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
# ["execute", "--format", "markdown"] |
|
468
|
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=back |
|
470
|
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
=cut |
|
472
|
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
=head1 AUTHORS |
|
474
|
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
Awncorp, C |
|
476
|
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
=cut |
|
478
|
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
=head1 LICENSE |
|
480
|
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
Copyright (C) 2000, Awncorp, C. |
|
482
|
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under |
|
484
|
|
|
|
|
|
|
the terms of the Apache license version 2.0. |
|
485
|
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
=cut |