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