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