line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Getopt::ArgParse::Namespace; |
2
|
|
|
|
|
|
|
|
3
|
20
|
|
|
20
|
|
76
|
use Carp; |
|
20
|
|
|
|
|
25
|
|
|
20
|
|
|
|
|
1014
|
|
4
|
20
|
|
|
20
|
|
73
|
use strict; |
|
20
|
|
|
|
|
19
|
|
|
20
|
|
|
|
|
409
|
|
5
|
20
|
|
|
20
|
|
64
|
use warnings; |
|
20
|
|
|
|
|
23
|
|
|
20
|
|
|
|
|
5300
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
33
|
|
|
33
|
0
|
409
|
my $class = shift; |
9
|
33
|
|
33
|
|
|
235
|
my $real_class = ref $class || $class; |
10
|
|
|
|
|
|
|
|
11
|
33
|
|
|
|
|
67
|
my $self = {}; |
12
|
|
|
|
|
|
|
|
13
|
33
|
|
|
|
|
607
|
bless $self, $real_class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub set_attr { |
17
|
472
|
|
|
472
|
0
|
1276
|
my $self = shift; |
18
|
472
|
|
|
|
|
424
|
my ($dest, $values) = @_; |
19
|
|
|
|
|
|
|
|
20
|
472
|
|
|
|
|
796
|
$self->{'-values'}{$dest} = $values; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub get_attr { |
24
|
799
|
|
|
799
|
0
|
2417
|
my $self = shift; |
25
|
799
|
|
|
|
|
674
|
my ($dest) = @_; |
26
|
|
|
|
|
|
|
|
27
|
799
|
50
|
|
|
|
1019
|
confess "Must provide $dest" unless $dest; |
28
|
|
|
|
|
|
|
|
29
|
799
|
100
|
|
|
|
2333
|
return $self->{'-values'}{$dest} if exists $self->{'-values'}{$dest}; |
30
|
|
|
|
|
|
|
|
31
|
204
|
|
|
|
|
2107
|
return undef; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $AUTOLOAD; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub AUTOLOAD { |
37
|
75
|
|
|
75
|
|
3653
|
my $sub = $AUTOLOAD; |
38
|
|
|
|
|
|
|
|
39
|
75
|
|
|
|
|
298
|
(my $dest = $sub) =~ s/.*:://; |
40
|
|
|
|
|
|
|
|
41
|
75
|
|
|
|
|
105
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
75
|
100
|
|
|
|
171
|
if ( exists $self->{'-values'}{$dest} ) { |
44
|
74
|
|
|
|
|
92
|
my $values = $self->{'-values'}{$dest}; |
45
|
74
|
100
|
|
|
|
188
|
if (ref($values) eq 'ARRAY') { |
|
|
100
|
|
|
|
|
|
46
|
14
|
100
|
|
|
|
59
|
return wantarray ? @$values : $values; |
47
|
|
|
|
|
|
|
} elsif (ref($values) eq 'HASH') { |
48
|
8
|
50
|
|
|
|
38
|
return wantarray ? %$values : $values; |
49
|
|
|
|
|
|
|
} else { |
50
|
52
|
|
|
|
|
203
|
return $values; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} else { |
53
|
1
|
|
|
|
|
15
|
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 |