foo
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Meta / Attribute.pm
CommitLineData
5dac17c3 1
2package MooseX::Getopt::Meta::Attribute;
3use Moose;
4
8034a232 5our $VERSION = '0.01';
6our $AUTHORITY = 'cpan:STEVAN';
7
8extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
5dac17c3 9
10has 'cmd_flag' => (
11 is => 'rw',
12 isa => 'Str',
13 predicate => 'has_cmd_flag',
14);
15
8034a232 16no Moose; 1;
5dac17c3 17
18__END__
19
20
21=pod
22
23=head1 NAME
24
8034a232 25MooseX::Getopt::Meta::Attribute - Optional meta attribute for custom option names
5dac17c3 26
27=head1 SYNOPSIS
28
8034a232 29 package App;
30 use Moose;
31
32 with 'MooseX::Getopt';
33
34 has 'data' => (
35 metaclass => 'MooseX::Getopt::Meta::Attribute',
36 is => 'ro',
37 isa => 'Str',
38 default => 'file.dat',
39 # tells MooseX::Getopt to use -f as the
40 # command line flag instead of the normal
41 # autogenerated one (--data)
42 cmd_flag => 'f',
43 );
44
5dac17c3 45=head1 DESCRIPTION
46
8034a232 47This is a custom attribute metaclass which can be used to specify a
48the specific command line flag to use instead of the default one
49which L<MooseX::Getopt> will create for you.
50
51This is certainly not the prettiest way to go about this, but for
52now it works for those who might need such a feature.
53
5dac17c3 54=head1 METHODS
55
8034a232 56These methods are of little use to most users, they are used interally
57within L<MooseX::Getopt>.
58
5dac17c3 59=over 4
60
61=item B<cmd_flag>
62
63=item B<has_cmd_flag>
64
65=item B<meta>
66
67=back
68
69=head1 BUGS
70
71All complex software has bugs lurking in it, and this module is no
72exception. If you find a bug please either email me, or add the bug
73to cpan-RT.
74
75=head1 AUTHOR
76
77Stevan Little E<lt>stevan@iinteractive.comE<gt>
78
79=head1 COPYRIGHT AND LICENSE
80
81Copyright 2007 by Infinity Interactive, Inc.
82
83L<http://www.iinteractive.com>
84
85This library is free software; you can redistribute it and/or modify
86it under the same terms as Perl itself.
87
88=cut