File Coverage

blib/lib/Pod/Usage/CommandLine.pm
Criterion Covered Total %
statement 19 22 86.3
branch n/a
condition 0 2 0.0
subroutine 7 7 100.0
pod n/a
total 26 31 83.8


line stmt bran cond sub pod time code
1             package Pod::Usage::CommandLine;
2              
3 1     1   41446 use strict;
  1         2  
  1         35  
4 1     1   4 use warnings;
  1         1  
  1         39  
5              
6             our $VERSION = '0.04';
7              
8 1     1   914 use Pod::Usage;
  1         115594  
  1         181  
9 1     1   1641 use Getopt::Long;
  1         20134  
  1         7  
10 1     1   162 use File::Basename;
  1         2  
  1         90  
11 1     1   5 use base 'Exporter';
  1         2  
  1         259  
12             our @EXPORT_OK = qw(GetOptions pod2usage);
13              
14             INIT
15             {
16             Getopt::Long::Parser
17             ->new(config => [qw(pass_through no_auto_abbrev no_ignore_case)] )
18             ->getoptions
19             (
20 0           'help|h|?' => sub { pod2usage(-exitstatus => 0); },
21 0           'man|m' => sub { pod2usage(-exitstatus => 0, -verbose => 2); },
22             version => sub
23             {
24 0   0       pod2usage(-exitstatus => 0,
25             -msg => basename($0) . ' ' . ($main::VERSION or '0.0'),
26             -verbose => 99,
27             -sections => 'COPYRIGHT.*|LICENSE.*|AUTHOR.*');
28             }
29 1     1   14 );
30             }
31              
32             1;
33             __END__