Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: MooseX::GetOpt disable in role

by markjugg (Curate)
on Aug 06, 2013 at 19:25 UTC ( #1048169=note: print w/ replies, xml ) Need Help??

in reply to Re: MooseX::GetOpt disable in role
in thread MooseX::GetOpt disable in role

If you always want to disable the same attributes for MooseX::Getopt from your role, then this worked for me:

package My::Role::Getopt { use Moose::Role; with 'My::Role::DB'; with 'My::Role::Log'; with 'MooseX::Getopt::Dashes'; before 'process_argv' => sub { my $self = shift; my @attrs_to_exclude_from_getopt = ( '+db', ... ); for my $attr (@attrs_to_exclude_from_getopt) { $self->meta->add_attribute($attr => (traits => ['NoGetopt' +])); } }; no Moose::Role; }

Comment on Re^2: MooseX::GetOpt disable in role
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048169]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2016-02-07 06:09 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (249 votes), past polls