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