1MooseX::App::Meta::RoleU:s:eArttCroinbturtiebM:uo:toOespdetXiP:oe:nrA(lp3p)D:o:cMuemtean:t:aRtoiloen::Attribute::Option(3)
2
3
4

NAME

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

DESCRIPTION

10       This meta attribute role will automatically be applied to all
11       attributes that should be used as options.
12

ACCESSORS

14       In your app and command classes you can use the following attributes in
15       option or parameter definitions.
16
17        option 'myoption' => (
18            is                 => 'rw',
19            isa                => 'ArrayRef[Str]',
20            documentation      => 'My special option',
21            cmd_flag           => 'myopt',
22            cmd_aliases        => [qw(mopt localopt)],
23            cmd_tags           => [qw(Important!)],
24            cmd_env            => 'MY_OPTION',
25            cmd_position       => 1,
26            cmd_split          => qr/,/,
27            cmd_negate         => 'notoption'
28        );
29
30   cmd_flag
31       Use this name instead of the attribute name as the option name
32
33   cmd_type
34       Option to mark if this attribute should be used as an option or
35       parameter value.
36
37       Allowed values are:
38
39       ·   option - Command line option
40
41       ·   proto - Command line option that should be processed prior to other
42           options (eg. a config-file option that sets other attribues)
43           Usually only used for plugin developmemt
44
45       ·   parameter - Positional parameter command line value
46
47   cmd_env
48       Environment variable name (only uppercase letters, numeric and
49       underscores allowed). If variable was not specified otherwise the value
50       will be taken from %ENV.
51
52   cmd_aliases
53       Arrayref of alternative option names
54
55   cmd_tags
56       Extra option tags displayed in the usage information (in brackets)
57
58   cmd_position
59       Override the order of the parameters in the usage message.
60
61   cmd_split
62       Splits multiple values at the given separator string or regular
63       expression.  Only works in conjunction with an 'ArrayRef[*]' type
64       constraint.  ie. '--myattr value1,value2' with cmd_split set to ','
65       would produce an arrayref with to elements.
66
67   cmd_count
68       Similar to the Getopt::Long '+' modifier, cmd_count turns the attribute
69       into a counter. Every occurrence of the attribute in @ARGV (without any
70       value) would increment the resulting value by one
71
72   cmd_negate
73       Sets names for the negated variant of a boolean field. Only works in
74       conjunction with a 'Bool' type constraint.
75

METHODS

77       These methods are only of interest to plugin authors.
78
79   cmd_check
80       Runs sanity checks on options and parameters. Will usually only be
81       executed if either HARNESS_ACTIVE or APP_DEVELOPER environment are set.
82
83   cmd_name_possible
84        my @names = $attribute->cmd_name_possible();
85
86       Returns a list of all possible option names.
87
88   cmd_name_list
89        my @names = $attribute->cmd_name_list();
90
91       Similar to cmd_name_possible this method returns a list of option
92       names, except for names set via cmd_negate.
93
94   cmd_name_primary
95        my $name = $attribute->cmd_name_primary();
96
97       Returns the primary option name
98
99   cmd_usage_name
100        my $name = $attribute->cmd_usage_name();
101
102       Returns the name as used by the usage text
103
104   cmd_usage_description
105        my $name = $attribute->cmd_usage_description();
106
107       Returns the description as used by the usage text
108
109   cmd_tags_list
110        my @tags = $attribute->cmd_tags_list();
111
112       Returns a list of tags
113
114   cmd_type_constraint_check
115        $attribute->cmd_type_constraint_check($value)
116
117       Checks the type constraint. Returns an error message if the check fails
118
119   cmd_type_constraint_description
120        $attribute->cmd_type_constraint_description($type_constraint,$singular)
121
122       Creates a description of the selected type constraint.
123
124
125
126perl v5.28.1                     M2o0o1s7e-X0:9:-A0p5p::Meta::Role::Attribute::Option(3)
Impressum