MooseX:...rsedArgv(3)

πŸ’– MooseX::App::ParsedArgv(3) β€” parses @ARGV πŸ’–

Okay so this page is from the User Contributed Perl Documentation manual, and it's giving very helpful helper-class energy. Pull up a chair, bestie 🫢

🌸 NAME 🌸

MooseX::App::ParsedArgv β€” Parses @ARGV.

✨ SYNOPSIS ✨

use MooseX::App::ParsedArgv;
my $argv = MooseX::App::ParsedArgv->instance;

foreach my $option ($argv->available('option')) {
    say "Parsed ".$option->key;
}

πŸ¦‹ DESCRIPTION πŸ¦‹

This is a helper class that holds all options parsed from @ARGV, no cap. It is implemented as a singleton ✨

Bestie PSA: unless you are developing a MooseX::App plugin, you usually do not need to interact with this class. It's lowkey an internal icon, iykyk πŸ’…

πŸ’œ METHODS πŸ’œ

πŸ†• new

Create a new MooseX::App::ParsedArgv instance. It needs to be called as soon as possible β€” like literally ASAP, bestie ⏰

πŸ’« instance

Get the current MooseX::App::ParsedArgv instance. If there is no instance, a new one will be created πŸŽ€

πŸ“ argv

Accessor for the initinal @ARGV β€” yes, that's the original spelling, and we're keeping it cute and exact 🫢

🧚 hints

ArrayRef of attributes that tells the parser which attributes should be regarded as flags without values 🌈

⭐ first_argv

Shifts the current first element from @ARGV 🫑

πŸ‘‘ available

my @options = $self->available($type);
OR
my @options = $self->available();

Returns an array of all parsed options or parameters that have not yet been consumed. The array elements will be MooseX::App::ParsedArgv::Element objects πŸ’–

πŸ”₯ consume

my $option = $self->consume($type);
OR
my $option = $self->consume();

Returns the first option/parameter of the local @ARGV that has not yet been consumed as a MooseX::App::ParsedArgv::Element object ✨

🌈 elements

Returns all parsed options and parameters πŸ¦‹

πŸŽ€ extra

Returns an array reference of unconsumed positional parameters and extra values πŸ’œ


Okay bestie, that's the whole page πŸ’– This one is from perl v5.42.0, dated 2024-08-09, and yes that's the cute little sign-off. Slay. πŸŽ€

πŸ“¦ where this page comes from