lib/Log/Munger/App/Command.pm

filter: Statementstmt 70.0% 7 / 10 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 73.3% 11 / 15 CC 2 SCAR 6.9
CC
2
Cov
67%
validate_args
2.5
BEGIN
1.0
CRAP 2.0
« lib/Log/Munger/App/Command/grok2rules.pm ↑ Summary lib/Log/Munger/App/Command/list.pm »
1 package Log::Munger::App::Command;
2 16 ▶use App::Cmd::Setup -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 =head1 NAME
5  
6 Log::Munger::App::Command - Base class for log_munger subcommands.
7  
8 =cut
9  
10 # The App::Cmd validation hook. Handles --help by dispatching to the help
11 # command for the current subcommand and exiting, then hands everything else to
12 # the subcommand's own validate method.
13 #
14 # Args:
15 #
16 # - $opt :: The parsed options hash ref, as App::Cmd passes it.
17 #
18 # - $args :: Array ref of the remaining command line args.
19 #
20 # Returns whatever the subcommand's validate returns, or exits for --help.
21 16 ▶sub validate_args {
Subroutine validate_args: called CC=2 SCAR=9.2
Pod documented
22 16 my ( $self, $opt, $args ) = @_;
23 16 ▶ if ( $opt->{help} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($opt->{"help"}) 0 16 16
24 0 my ($command) = $self->command_names;
25 0 $self->app->execute_command( $self->app->prepare_command( "help", $command ) );
26 0 exit;
27 }
28 16 $self->validate( $opt, $args );
29 }
30  
31 16 return 1;
« lib/Log/Munger/App/Command/grok2rules.pm ↑ Summary lib/Log/Munger/App/Command/list.pm »