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