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


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

Index


Code Index:

NAME

Top

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

DESCRIPTION

Top

This is an stricter version of MooseX::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


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

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

use Moose::Role;

with 'MooseX::Getopt';

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

no Moose::Role;

1;


__END__