line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
40934
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
63
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
87
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Getopt::Inherited; |
6
|
|
|
|
|
|
|
our $VERSION = '1.100860'; |
7
|
|
|
|
|
|
|
# ABSTRACT: Handling inherited command-line options |
8
|
1
|
|
|
1
|
|
1689
|
use Getopt::Long; |
|
1
|
|
|
|
|
31468
|
|
|
1
|
|
|
|
|
86
|
|
9
|
1
|
|
|
1
|
|
12877
|
use Pod::Usage; |
|
1
|
|
|
|
|
77012
|
|
|
1
|
|
|
|
|
146
|
|
10
|
1
|
|
|
|
|
11
|
use parent qw( |
11
|
|
|
|
|
|
|
Class::Accessor::Complex |
12
|
|
|
|
|
|
|
Data::Inherited |
13
|
1
|
|
|
1
|
|
11
|
); |
|
1
|
|
|
|
|
1
|
|
14
|
|
|
|
|
|
|
__PACKAGE__->mk_hash_accessors(qw(opt)); |
15
|
|
|
|
|
|
|
Getopt::Long::Configure('no_ignore_case'); |
16
|
1
|
|
|
1
|
|
37548
|
use constant GETOPT => (qw(help man logfile|log=s verbose|v+ version|V)); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
541
|
|
17
|
1
|
|
|
1
|
|
8
|
use constant GETOPT_DEFAULTS => (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
296
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub usage { |
20
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
21
|
0
|
|
|
|
|
0
|
require Pod::Usage; |
22
|
0
|
|
|
|
|
0
|
Pod::Usage::pod2usage(@_); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub do_getopt { |
26
|
2
|
|
|
2
|
1
|
1092
|
my $self = shift; |
27
|
2
|
|
|
|
|
6
|
my %opt; |
28
|
2
|
50
|
|
|
|
24
|
GetOptions(\%opt, $self->every_list('GETOPT')) or $self->usage(2); |
29
|
2
|
50
|
|
|
|
3420
|
$self->usage(1) if $opt{help}; |
30
|
2
|
50
|
|
|
|
9
|
$self->usage(-exitstatus => 0, -verbose => 2) if $opt{man}; |
31
|
2
|
|
|
|
|
17
|
my %defaults = $self->every_hash('GETOPT_DEFAULTS'); |
32
|
2
|
|
|
|
|
379
|
while (my ($key, $value) = each %defaults) { |
33
|
2
|
100
|
|
|
|
7
|
next if defined $opt{$key}; |
34
|
1
|
|
|
|
|
5
|
$opt{$key} = $value; |
35
|
|
|
|
|
|
|
} |
36
|
2
|
|
|
|
|
14
|
$self->opt(%opt); |
37
|
2
|
|
|
|
|
48
|
$self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |