Skip Menu |

This queue is for tickets about the MooseX-Getopt CPAN distribution.

Report information
The Basics
Id: 42967
Status: open
Priority: 0/
Queue: MooseX-Getopt

People
Owner: Nobody in particular
Requestors: ctbrown [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.15
Fixed in: (no value)



It would be nice if MooseX::Getopt supported the incremental options "verbose+"-type option for 'Int' types so that a command line of "--verbose --verbose" will set the verbose=2. Best Wishes, Chris
Am Mo 02. Feb 2009, 11:06:55, CTBROWN schrieb: Show quoted text
> It would be nice if MooseX::Getopt supported the incremental options > "verbose+"-type option for 'Int' types so that a command line of > "--verbose --verbose" will set the verbose=2. > > Best Wishes, > > Chris
You can configure it this way: use Moose; use Moose::Util::TypeConstraints; use MooseX::Getopt::OptionTypeMap; subtype 'Verbosity', as 'Int', where { $_ >= 0 }; MooseX::Getopt::OptionTypeMap->add_option_type_to_map( Verbosity => '+' ); with 'MooseX::Getopt'; has 'verbose' => (is => 'ro', isa => 'Verbosity');