Getopt-O2

 view release on metacpan or  search on metacpan

t/02.getopt.t  view on Meta::CPAN

		CORE::exit($_[0] // 0);
	};

	use_ok('Getopt::O2');
}

use parent 'Getopt::O2';

# Usage called?
{
	local @ARGV = qw(-h);
	local $override{exit} = 1;

	my $cmdline = __PACKAGE__->new();
	my $mock = Test::MockObject::Extends->new($cmdline);

	$mock->mock(get_option_rules => sub {
		$cmdline->SUPER::get_option_rules,
		'e|enum=?' => ['A choice', 'values' => [qw(foo splort gnarf)]],
		'f|flag' => ['A flag', 'default' => undef],
		'p|param=s' => 'A parameter',

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.894 second using v1.00-cache-2.02-grep-82fe00e-cpan-c9a218a2bbc )