1MouseX::Getopt::Meta::AUtsterribCuotnet:r:iTbruatMieotdu(s3PepeXmr:)l:GDeotcoupmte:n:tMaettiao:n:Attribute::Trait(3pm)
2
3
4
6 package App;
7 use Mouse;
8
9 with 'MouseX::Getopt';
10
11 has 'data' => (
12 traits => [ 'Getopt' ],
13 is => 'ro',
14 isa => 'Str',
15 default => 'file.dat',
16
17 # tells MouseX::Getopt to use --somedata as the
18 # command line flag instead of the normal
19 # autogenerated one (--data)
20 cmd_flag => 'somedata',
21
22 # tells MouseX::Getopt to also allow --moosedata,
23 # -m, and -d as aliases for this same option on
24 # the commandline.
25 cmd_aliases => [qw/ moosedata m d /],
26
27 # Or, you can use a plain scalar for a single alias:
28 cmd_aliases => 'm',
29 );
30
32 This is a custom attribute metaclass trait which can be used to specify
33 a the specific command line flag to use instead of the default one
34 which MouseX::Getopt will create for you.
35
36 cmd_flag
37 Changes the commandline flag to be this value, instead of the
38 default, which is the same as the attribute name.
39
40 cmd_aliases
41 Adds more aliases for this commandline flag, useful for short
42 options and such.
43
44 has_cmd_flag
45 has_cmd_aliases
46
47
48
49perl v5.30.1 20M2o0u-s0e1X-:3:0Getopt::Meta::Attribute::Trait(3pm)