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