line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Command; |
2
|
1
|
|
|
1
|
|
5
|
use CLI::Base; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
3
|
|
|
|
|
|
|
@ISA = ("CLI::Base"); |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use CLI qw(TIME); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
51
|
|
8
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
192
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
4
|
|
|
4
|
0
|
4
|
my $proto = shift; |
12
|
4
|
|
33
|
|
|
11
|
my $class = ref($proto) || $proto; |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
|
|
3
|
my $name = shift; |
15
|
4
|
|
|
|
|
3
|
my $func = shift; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
7
|
my $self = { |
18
|
|
|
|
|
|
|
NAME => $name, |
19
|
|
|
|
|
|
|
TYPE => undef, |
20
|
|
|
|
|
|
|
VALUE => undef, |
21
|
|
|
|
|
|
|
MIN => undef, |
22
|
|
|
|
|
|
|
MAX => undef, |
23
|
|
|
|
|
|
|
FUNC => $func |
24
|
|
|
|
|
|
|
}; |
25
|
4
|
|
|
|
|
4
|
bless ($self, $class); |
26
|
4
|
|
|
|
|
6
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub parse { |
30
|
2
|
|
|
2
|
0
|
2
|
my $self = shift; |
31
|
2
|
|
|
|
|
3
|
my $value = shift; |
32
|
|
|
|
|
|
|
|
33
|
2
|
50
|
|
|
|
16
|
if (defined $self->function()) { |
34
|
2
|
|
|
|
|
5
|
&{$self->function()}($value); |
|
2
|
|
|
|
|
4
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|