lib/Log/Munger/App/Command/list.pm

filter: Statementstmt 88.0% 22 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 80.0% 4 / 5 totaltotal 82.9% 34 / 41 CC 3 SCAR 5.6
CC
3
Cov
85%
execute
3.1
abstract
2.0
description
2.0
CRAP 1.7
« lib/Log/Munger/App/Command.pm ↑ Summary lib/Log/Munger/App/Command/which_rule_file.pm »
1 package Log::Munger::App::Command::list;
2  
3 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use Log::Munger::App -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use Log::Munger::WhichRuleFile ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub opt_spec {
Subroutine opt_spec: called CC=1 SCAR=0.0
Pod documented
9 2 return ( [ 'paths|p', 'Also show the resolved path of each rule file.' ], );
10 }
11  
12 0 ▶sub abstract { "List the rule files discoverable across the search path" }
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
13  
14 0 ▶sub description {
Subroutine description: not called CC=1 SCAR=6.9
Pod documented
15 0 "Lists the rule files found across the directory named by the LOG_MUNGER_RULES_DIR environment
16 variable (when set), /etc/log_munger/rules, /usr/local/etc/log_munger/rules, and
17 the dist share dir, in that precedence order. A name found in an earlier directory shadows the
18 same name in a later one, and only the one that would actually be used is listed.
19  
20 Add -p to see what each name resolves to.
21 ";
22 }
23  
24 2 ▶sub validate { return 1 }
Subroutine validate: called CC=1 SCAR=0.0
Pod undocumented
25  
26 2 ▶sub execute {
Subroutine execute: called CC=3 SCAR=11.2
Pod documented
27 2 my ( $self, $opts, $args ) = @_;
28  
29 2 my $available = Log::Munger::WhichRuleFile->available_rule_files;
30  
31 2 foreach my $name ( sort( keys( %{$available} ) ) ) {
32 180 ▶ if ( $opts->{'paths'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts->{'paths'}) { } 0 180 180
33 0 printf( "%-24s %s\n", $name, $available->{$name} );
34 } else {
35 180 print "$name\n";
36 }
37 }
38  
39 2 return;
40 } ## end sub execute
41  
42 16 1;
« lib/Log/Munger/App/Command.pm ↑ Summary lib/Log/Munger/App/Command/which_rule_file.pm »