1MooseX::App::ParsedArgvU(s3e)r Contributed Perl DocumentaMtoioosneX::App::ParsedArgv(3)
2
3
4
6 MooseX::App::ParsedArgv - Parses @ARGV
7
9 use MooseX::App::ParsedArgv;
10 my $argv = MooseX::App::ParsedArgv->instance;
11
12 foreach my $option ($argv->available('option')) {
13 say "Parsed ".$option->key;
14 }
15
17 This is a helper class that holds all options parsed from @ARGV. It is
18 implemented as a singleton. Unless you are developing a MooseX::App
19 plugin you usually do not need to interact with this class.
20
22 new
23 Create a new MooseX::App::ParsedArgv instance. Needs to be called as
24 soon as possible.
25
26 instance
27 Get the current MooseX::App::ParsedArgv instance. If there is no
28 instance a new one will be created.
29
30 argv
31 Accessor for the initinal @ARGV.
32
33 hints
34 ArrayRef of attributes that tells the parser which attributes should be
35 regarded as flags without values.
36
37 first_argv
38 Shifts the current first element from @ARGV.
39
40 available
41 my @options = $self->available($type);
42 OR
43 my @options = $self->available();
44
45 Returns an array of all parsed options or parameters that have not yet
46 been consumed. The array elements will be
47 MooseX::App::ParsedArgv::Element objects.
48
49 consume
50 my $option = $self->consume($type);
51 OR
52 my $option = $self->consume();
53
54 Returns the first option/parameter of the local @ARGV that has not yet
55 been consumed as a MooseX::App::ParsedArgv::Element object.
56
57 elements
58 Returns all parsed options and parameters.
59
60 extra
61 Returns an array reference of unconsumed positional parameters and
62 extra values.
63
64
65
66perl v5.36.0 2022-07-22 MooseX::App::ParsedArgv(3)