Maroš Kollár > MooseX-App-1.17 > MooseX::App::Meta::Role::Attribute::Option

Download:
MooseX-App-1.17.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: MooseX-App-1.30

NAME ^

MooseX::App::Meta::Role::Attribute::Option - Meta attribute role for options

DESCRIPTION ^

This meta attribute role will automatically be applied to all attributes that should be used as options. This documentation is only of interest if you intent to write plugins for MooseX-App.

ACCESSORS ^

cmd_flag

Use this name instead of the attribute name as the option name

cmd_option

Boolean flag to mark if this attribute should be used as an option

cmd_aliases

Arrayref of alternative option names

cmd_proto

Boolean flag to mark this attribute as proto option. Proto attributes will be parsed before all other options (eg. a config-file option that sets other attribues)

cmd_tags

Extra option tags displayed in the usage information (in brackets)

METHODS ^

cmd_name_possible

 my @names = $attribute->cmd_name_possible();

Returns a list of all possible option names.

cmd_name_primary

 my $name = $attribute->cmd_name_primary();

Returns the primary option name

cmd_usage

 my ($name,$description) = $attribute->command_usage_attribute_detail();

Returns a name and description for a given meta attribute class.

cmd_tags_list

 my @tags = $attribute->cmd_tags_list();

Returns a list of tags for a given meta attribute class.

cmd_is_bool

 my $bool = $attribute->cmd_is_bool();

Returns true, false or undef depending on the type constraint and default of the attribute:

syntax highlighting: