2 package MooseX::Getopt::Meta::Attribute;
6 our $AUTHORITY = 'cpan:STEVAN';
8 extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
13 predicate => 'has_cmd_flag',
16 has 'cmd_aliases' => (
19 predicate => 'has_cmd_aliases',
31 MooseX::Getopt::Meta::Attribute - Optional meta attribute for custom option names
38 with 'MooseX::Getopt';
41 metaclass => 'MooseX::Getopt::Meta::Attribute',
44 default => 'file.dat',
45 # tells MooseX::Getopt to use --somedata as the
46 # command line flag instead of the normal
47 # autogenerated one (--data)
48 cmd_flag => 'somedata',
49 # tells MooseX::Getopt to also allow --moosedata,
50 # -m, and -d as aliases for this same option on
52 cmd_aliases => [qw/ moosedata m d /],
57 This is a custom attribute metaclass which can be used to specify a
58 the specific command line flag to use instead of the default one
59 which L<MooseX::Getopt> will create for you.
61 This is certainly not the prettiest way to go about this, but for
62 now it works for those who might need such a feature.
66 These methods are of little use to most users, they are used interally
67 within L<MooseX::Getopt>.
73 Changes the commandline flag to be this value, instead of the default,
74 which is the same as the attribute name.
78 Adds more aliases for this commandline flag, useful for short options
83 =item B<has_cmd_aliases>
91 All complex software has bugs lurking in it, and this module is no
92 exception. If you find a bug please either email me, or add the bug
97 Stevan Little E<lt>stevan@iinteractive.comE<gt>
99 =head1 COPYRIGHT AND LICENSE
101 Copyright 2007 by Infinity Interactive, Inc.
103 L<http://www.iinteractive.com>
105 This library is free software; you can redistribute it and/or modify
106 it under the same terms as Perl itself.