line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Amon2::CLI; |
2
|
6
|
|
|
6
|
|
409055
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
151
|
|
3
|
6
|
|
|
6
|
|
97
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
866
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub import { |
8
|
6
|
|
|
6
|
|
46
|
my ($self, $app_class, $cli_class) = @_; |
9
|
|
|
|
|
|
|
|
10
|
6
|
100
|
|
|
|
38
|
if ($app_class) { |
11
|
5
|
|
|
|
|
6
|
my $file = $app_class; |
12
|
5
|
|
|
|
|
13
|
$file =~ s!::!/!g; |
13
|
5
|
|
|
|
|
1856
|
require "$file.pm"; ## no critic |
14
|
5
|
|
|
|
|
118071
|
$app_class->import; |
15
|
5
|
|
66
|
|
|
64
|
$app_class->load_plugins( |
16
|
|
|
|
|
|
|
'CLI' => { |
17
|
|
|
|
|
|
|
base => $cli_class || "${app_class}::CLI", |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |