Commit | Line | Data |
---|---|---|
bff3807b | 1 | |
2 | package MooseX::Getopt::Strict; | |
3 | use Moose::Role; | |
4 | ||
f969917f | 5 | with 'MooseX::Getopt'; |
bff3807b | 6 | |
0f8232b6 | 7 | around '_compute_getopt_attrs' => sub { |
8 | my $next = shift; | |
5b582f22 | 9 | my ($class, @args) = @_; |
ac2073c8 | 10 | |
11 | return grep { | |
12 | $_->does('MooseX::Getopt::Meta::Attribute::Trait') | |
0f8232b6 | 13 | } $class->$next(@args); |
14 | }; | |
bff3807b | 15 | |
0f8232b6 | 16 | 1; |
bff3807b | 17 | |
18 | __END__ | |
19 | ||
20 | =pod | |
21 | ||
22 | =head1 NAME | |
23 | ||
24 | MooseX::Getopt::Strict - only make options for attrs with the Getopt metaclass | |
ac2073c8 | 25 | |
0f8232b6 | 26 | =head1 DESCRIPTION |
bff3807b | 27 | |
ac2073c8 | 28 | This is an stricter version of C<MooseX::Getopt> which only processes the |
0f8232b6 | 29 | attributes if they explicitly set as C<Getopt> attributes. All other attributes |
30 | are ignored by the command line handler. | |
ac2073c8 | 31 | |
0f8232b6 | 32 | =head1 METHODS |
bff3807b | 33 | |
34 | =over 4 | |
35 | ||
36 | =item meta | |
37 | ||
0f8232b6 | 38 | =back |
bff3807b | 39 | |
ac2073c8 | 40 | =head1 SEE ALSO |
41 | ||
42 | =over 4 | |
43 | ||
44 | =item L<MooseX::Getopt> | |
45 | ||
46 | =back | |
47 | ||
0f8232b6 | 48 | =head1 BUGS |
bff3807b | 49 | |
ac2073c8 | 50 | All complex software has bugs lurking in it, and this module is no |
0f8232b6 | 51 | exception. If you find a bug please either email me, or add the bug |
52 | to cpan-RT. | |
53 | ||
54 | =head1 AUTHOR | |
55 | ||
56 | Stevan Little E<lt>stevan@iinteractive.comE<gt> | |
57 | ||
58 | Yuval Kogman C<< <nuffin@cpan.org> >> | |
59 | ||
60 | =head1 COPYRIGHT AND LICENSE | |
61 | ||
adbe3e57 | 62 | Copyright 2007-2008 by Infinity Interactive, Inc. |
0f8232b6 | 63 | |
64 | L<http://www.iinteractive.com> | |
65 | ||
66 | This library is free software; you can redistribute it and/or modify | |
67 | it under the same terms as Perl itself. | |
bff3807b | 68 | |
69 | =cut |