MouseX::Getopt::Strict - only make options for attrs with the Getopt metaclass


MouseX-Getopt documentation Contained in the MouseX-Getopt distribution.

Index


Code Index:

NAME

Top

MouseX::Getopt::Strict - only make options for attrs with the Getopt metaclass

DESCRIPTION

Top

This is an stricter version of MouseX::Getopt which only processes the attributes if they explicitly set as Getopt attributes. All other attributes are ignored by the command line handler.

AUTHORS

Top

COPYRIGHT AND LICENSE

Top


MouseX-Getopt documentation Contained in the MouseX-Getopt distribution.

package MouseX::Getopt::Strict;
BEGIN {
  $MouseX::Getopt::Strict::AUTHORITY = 'cpan:STEVAN';
}
BEGIN {
  $MouseX::Getopt::Strict::VERSION = '0.33';
}
# ABSTRACT: only make options for attrs with the Getopt metaclass

use Mouse::Role;

with 'MouseX::Getopt';

around '_compute_getopt_attrs' => sub {
    my $next = shift;
    my ( $class, @args ) = @_;
    grep {
        $_->does("MouseX::Getopt::Meta::Attribute::Trait")
    } $class->$next(@args);
};

no Mouse::Role;

1;


__END__