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