App-Commando

 view release on metacpan or  search on metacpan

t/argv.t  view on Meta::CPAN

        expected_config => {},
    },
    'Two arguments and one long switch' => {
        ARGV            => [ '--bar', 'xyzzy', 'zzyxy' ],
        expected_argv   => [ 'xyzzy', 'zzyxy' ],
        expected_config => { 'bar' => '1' },
    },
);

for my $test_name (keys %tests) {
    local @ARGV = @{$tests{$test_name}->{ARGV}};

    my $program = App::Commando::program('test');
    $program->option('foo', '-f', '--foo', 'Enables foo');
    $program->option('bar', '-b', '--bar', 'Enables bar');
    $program->action(sub {
        my ($argv, $config) = @_;

        is_deeply $argv, $tests{$test_name}->{expected_argv},
            "$test_name: argv";
        is_deeply $config, $tests{$test_name}->{expected_config},

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

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