Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-07 03:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls