line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Getopt::ArgParse::Namespace; |
2
|
|
|
|
|
|
|
|
3
|
20
|
|
|
20
|
|
84
|
use Carp; |
|
20
|
|
|
|
|
30
|
|
|
20
|
|
|
|
|
1293
|
|
4
|
20
|
|
|
20
|
|
92
|
use strict; |
|
20
|
|
|
|
|
25
|
|
|
20
|
|
|
|
|
548
|
|
5
|
20
|
|
|
20
|
|
97
|
use warnings; |
|
20
|
|
|
|
|
24
|
|
|
20
|
|
|
|
|
6001
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
33
|
|
|
33
|
0
|
483
|
my $class = shift; |
9
|
33
|
|
33
|
|
|
197
|
my $real_class = ref $class || $class; |
10
|
|
|
|
|
|
|
|
11
|
33
|
|
|
|
|
76
|
my $self = {}; |
12
|
|
|
|
|
|
|
|
13
|
33
|
|
|
|
|
694
|
bless $self, $real_class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub set_attr { |
17
|
472
|
|
|
472
|
0
|
1270
|
my $self = shift; |
18
|
472
|
|
|
|
|
550
|
my ($dest, $values) = @_; |
19
|
|
|
|
|
|
|
|
20
|
472
|
|
|
|
|
1030
|
$self->{'-values'}{$dest} = $values; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub get_attr { |
24
|
799
|
|
|
799
|
0
|
3107
|
my $self = shift; |
25
|
799
|
|
|
|
|
803
|
my ($dest) = @_; |
26
|
|
|
|
|
|
|
|
27
|
799
|
50
|
|
|
|
1184
|
confess "Must provide $dest" unless $dest; |
28
|
|
|
|
|
|
|
|
29
|
799
|
100
|
|
|
|
2775
|
return $self->{'-values'}{$dest} if exists $self->{'-values'}{$dest}; |
30
|
|
|
|
|
|
|
|
31
|
204
|
|
|
|
|
2660
|
return undef; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $AUTOLOAD; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub AUTOLOAD { |
37
|
75
|
|
|
75
|
|
5618
|
my $sub = $AUTOLOAD; |
38
|
|
|
|
|
|
|
|
39
|
75
|
|
|
|
|
370
|
(my $dest = $sub) =~ s/.*:://; |
40
|
|
|
|
|
|
|
|
41
|
75
|
|
|
|
|
107
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
75
|
100
|
|
|
|
207
|
if ( exists $self->{'-values'}{$dest} ) { |
44
|
74
|
|
|
|
|
112
|
my $values = $self->{'-values'}{$dest}; |
45
|
74
|
100
|
|
|
|
218
|
if (ref($values) eq 'ARRAY') { |
|
|
100
|
|
|
|
|
|
46
|
14
|
100
|
|
|
|
80
|
return wantarray ? @$values : $values; |
47
|
|
|
|
|
|
|
} elsif (ref($values) eq 'HASH') { |
48
|
8
|
50
|
|
|
|
41
|
return wantarray ? %$values : $values; |
49
|
|
|
|
|
|
|
} else { |
50
|
52
|
|
|
|
|
257
|
return $values; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} else { |
53
|
1
|
|
|
|
|
21
|
croak "unknown option: $dest"; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
0
|
|
|
sub DESTROY { } |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Mytram (original author) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is Copyright (c) 2014 by Mytram. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software, licensed under: |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |