MooseX...Command(3pm)

πŸ“¦
version 0.34 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MooseX::App::Cmd::Command β€” the manual, but make it slay πŸ’–

okay bestie, so this page is straight out of the User Contributed Perl Documentation collection, and it's for MooseX...Command. That trailing (3pm) is just the man page section, iykyk β€” it means "perl module, section 3". And the version we're vibing with here is version 0.34 ✨


🌸 NAME 🌸

MooseX::App::Cmd::Command β€” it's the base class for MooseX::Getopt-based App::Cmd::Commands. That's the whole title, no notes. πŸ‘‘

✨ VERSION ✨

version 0.34 πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the actual snippet, copied verbatim because we do NOT mess with code in this house:

use Moose;

extends qw(MooseX::App::Cmd::Command);

# no need to set opt_spec
# see MooseX::Getopt for documentation on how to specify options
has option_field => (
    isa => 'Str',
    is  => 'rw',
    required => 1,
);

sub execute {
    my ( $self, $opts, $args ) = @_;

    print $self->option_field; # also available in $opts->{option_field}
}

the way that comment says # no need to set opt_spec?? iconic. you literally just… don't. and then MooseX::Getopt docs are where you go for how to specify options, periodt. πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so this is a replacement base class for App::Cmd::Command classes 🫢 it throws MooseX::Getopt all up in there, plus the glue that makes the two of them play nice together. they're combined. they're a unit. no cap. 😭

🌈 METHODS 🌈

_process_args 🧚

this one replaces App::Cmd::Command's argument processing in favor of MooseX::Getopt-based processing. out with the old, in with the moose πŸ’€

and hmm, listen β€” if your class does the MooseX::ConfigFromFile role (or any of its consuming roles, like MooseX::SimpleConfig), then this will hook you up with an additional --configfile command line option for loading options straight out of a configuration file. cute AND functional. ⭐

πŸ“ SUPPORT πŸ“

bugs?? bestie, they may be submitted through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-App-Cmd> β€” or you can email <bug-MooseX-App-Cmd@rt.cpan.org> πŸ’Œ

there's also a mailing list for users of this distribution, sitting pretty at <http://lists.perl.org/list/moose.html> πŸ‘‘

and there's an irc channel too, for users of this distribution, at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose> 🌸 come hang, fr fr.

πŸ‘‘ AUTHOR πŸ‘‘

XXXX XXX'XX (Yuval Kogman) β€” <nothingmuch@woobling.org> πŸ’–

This software is copyright (c) 2008 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like. go off. πŸŽ€


ngl the whole thing is free software and it's giving "just use it, bestie" energy. no gatekeeping. we love to see it. πŸ’œ

okay and for the lil sign-off moment: this page came from perl v5.36.0, dated 2022-10-16, and lives under the title MooseX...Command(3pm). that's the footer, babes β€” we folded it in, we said goodbye to it properly, we did NOT copy-paste the line. βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from