Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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 contemplating the Monastery: (4)
As of 2014-12-21 19:10 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (107 votes), past polls