MooseX:...s::Base(3)
π MooseX:...s::Base(3) β your meta-role bestie π
Okay so this page is MooseX:...s::Base(3) from the User Contributed Perl Documentation β manual name folded in near the top, bestie π«Ά. Itβs giving deep-internals plugin-writer lore, and weβre keeping every single detail, no cap.
β¨ NAME β¨
MooseX::App::Meta::Role::Class::Base β meta class role for application base class.
πΈ DESCRIPTION πΈ
This meta class role will automatically be applied to the application base class. This documentation is only of interest if you intend to write plugins for MooseX-App. Thatβs the whole vibe: useful if youβre writing plugins, otherwise you can absolutely scroll on π
.
π ACCESSORS π
π app_messageclass
Message class for generating error messages. Defaults to MooseX::App::Message::Block. The default can be overwritten by altering the _build_app_messageclass method. And because the original really said it twice: defaults to MooseX::App::Message::Block again ππ.
π¦ app_namespace
Usually MooseX::App will take the package name of the base class as the namespace for commands. This namespace can be changed.
π app_exclude
Exclude namespaces included in app_namespace.
π app_base
Usually MooseX::App will take the name of the calling wrapper script to construct the program name in various help messages. This name can be changed via the app_base accessor. Defaults to the base name of $0.
π app_fuzzy
Boolean flag that controls if command names and attributes should be matched exactly or fuzzy. Defaults to true.
π app_command_name
Coderef attribute that controls how package names are translated to command names and attributes. Defaults to &MooseX::App::Utils::class_to_command.
π§ app_commands
Hashref with command to command class map.
β app_strict
Boolean flag that controls if an application with superfluous/unknown positional parameters should terminate with an error message or not. If disabled all extra parameters will be copied to the extra_argv command class attribute.
π₯ app_prefer_commandline
By default, arguments passed to new_with_command and new_with_options have a higher priority than the command line options. This boolean flag will give the command line an higher priority.
π«Ά app_permute
Boolean flag that controls if command line arguments that take multiple values (ie ArrayRef or HashRef type constraints) can be permuted.
π₯ METHODS π₯
π command_check
Runs sanity checks on options and parameters. Will usually only be executed if either HARNESS_ACTIVE or APP_DEVELOPER environment are set.
π command_register
Registers an additional command. The call looks like this, exactly:
$self->command_register($command_moniker,$command_class);
π¦ command_get
Returns a command class for the given command moniker. The docs show this exact signature:
my $command_class = $self->command_register($command_moniker);
π command_class_to_command
Returns the command moniker for the given command class.
my $command_moniker = $meta->command_class_to_command($command_class);
β¨ command_message
Generates a message object (using the class from app_messageclass).
my $message = $meta->command_message(
header => $header,
type => 'error',
body => $message
);
π
command_usage_attributes
Returns a list of attributes/command options for the given meta class.
my @attributes = $meta->command_usage_attributes($metaclass);
πΈ command_usage_command
Returns a list of messages containing the documentation for a given command meta class.
my @messages = $meta->command_usage_command($command_metaclass);
π command_usage_description
Returns a messages with the basic command description. (Yes, βa messagesβ β iconic little grammar moment, but thatβs the text π.)
my $message = $meta->command_usage_description($command_metaclass);
π§ command_usage_global
Returns a list of messages containing the documentation for the application.
my @messages = $meta->command_usage_global();
β command_usage_header
Returns a message containing the basic usage documentation.
my $message = $meta->command_usage_header();
my $message = $meta->command_usage_header($command_meta_class);
π₯ command_find
Returns a list of command names matching the user input.
my @commands = $meta->command_find($commands_arrayref);
π command_candidates
Returns either a single command or an arrayref of possibly matching commands.
my $commands = $meta->command_candidates($user_command_input);
π«Ά command_proto
Returns all parsed options (as hashref) and erros (as arrayref) for the proto command. Is a wrapper around command_parse_options.
my ($result,$errors) = $meta->command_proto($command_meta_class);
π command_args
Returns all parsed options (as hashref) and erros (as arrayref) for the main command. Is a wrapper around command_parse_options.
my ($options,$errors) = $self->command_args($command_meta_class);
π¦ command_parse_options
Tries to parse the selected attributes from @ARGV.
my ($options,$errors) = $self->command_parse_options(\@attribute_metaclasses);
π command_scan_namespace
Scans a namespace for command classes. Returns a hash with command names as keys and package names as values.
my %namespaces = $self->command_scan_namespace($namespace);
β¨ command_process_attribute
The description literally says: TODO ###Returns a list of all attributes with the given type β unfinished-notes realness, but thatβs all the original gives us π« .
my @attributes = $self->command_process_attribute($attribute_metaclass,$matches);
π
command_usage_options
Returns the options usage as a message object.
my $usage = $self->command_usage_options($metaclass,$headline);
πΈ command_usage_parameters
Returns the positional parameters usage as a message object.
my $usage = $self->command_usage_parameters($metaclass,$headline);
π command_check_attributes
Checks all attributes. Returns/alters the $errors arrayref.
$errors = $self->command_check_attributes($command_metaclass,$errors,$params)
π§ command_parser_hints
Generates parser hints as required by MooseX::App::ParsedArgv.
$self->command_parser_hints($self,$metaclass)
π Thatβs the tea, bestie: this page is from perl v5.42.0, dated 2024-08-09, and itβs MooseX:...s::Base(3). Bye π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-MooseX-App 1.430.1-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms