work in progress, tests are failing, and parameterized role is not flexible enough...
[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' => { getopt_conf => [] };
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 Also, no L<Getopt::Long> global option is activated. Especially, 'pass_through' is
27 not set.
28
29 =cut