8241b149df6d802c01a3f12b868d5ea54a457578
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Strict.pm
1 package MooseX::Getopt::Strict;
2 # ABSTRACT: only make options for attrs with the Getopt metaclass
3
4 use Moose::Role;
5
6 with 'MooseX::Getopt';
7
8 around '_compute_getopt_attrs' => sub {
9     my $next = shift;
10     my ( $class, @args ) = @_;
11     grep {
12         $_->does("MooseX::Getopt::Meta::Attribute::Trait")
13     } $class->$next(@args);
14 };
15
16 no Moose::Role;
17
18 1;
19
20 =head1 DESCRIPTION
21
22 This is an stricter version of C<MooseX::Getopt> which only processes the
23 attributes if they explicitly set as C<Getopt> attributes. All other attributes
24 are ignored by the command line handler.
25
26 =cut