work in progress, tests are failing, and parameterized role is not flexible enough...
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Strict.pm
CommitLineData
bff3807b 1package MooseX::Getopt::Strict;
669588e2 2# ABSTRACT: only make options for attrs with the Getopt metaclass
3
bff3807b 4use Moose::Role;
5
a9e27700 6with 'MooseX::Getopt' => { getopt_conf => [] };
bff3807b 7
0f8232b6 8around '_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 16no Moose::Role;
bff3807b 17
669588e2 181;
bff3807b 19
0f8232b6 20=head1 DESCRIPTION
bff3807b 21
669588e2 22This is an stricter version of C<MooseX::Getopt> which only processes the
0f8232b6 23attributes if they explicitly set as C<Getopt> attributes. All other attributes
24are ignored by the command line handler.
bff3807b 25
a9e27700 26Also, no L<Getopt::Long> global option is activated. Especially, 'pass_through' is
27not set.
28
bff3807b 29=cut