line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::I18N::Command; |
2
|
1
|
|
|
1
|
|
5772
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
49
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
198
|
|
4
|
1
|
|
|
1
|
|
7
|
use base qw(App::CLI App::CLI::Command); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2212
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub options { |
7
|
|
|
|
|
|
|
return ( |
8
|
0
|
|
|
0
|
0
|
|
'h|help|?' => 'help', |
9
|
|
|
|
|
|
|
'man' => 'man', |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub alias { |
14
|
|
|
|
|
|
|
( |
15
|
0
|
|
|
0
|
0
|
|
"s" => "server", |
16
|
|
|
|
|
|
|
"p" => "parse", |
17
|
|
|
|
|
|
|
"l" => "lang", |
18
|
|
|
|
|
|
|
"export" => 'gen', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub invoke { |
23
|
0
|
|
|
0
|
0
|
|
my ($pkg, $cmd, @args) = @_; |
24
|
0
|
|
|
|
|
|
local *ARGV = [$cmd, @args]; |
25
|
0
|
|
|
|
|
|
my $ret = eval { |
26
|
0
|
|
|
|
|
|
$pkg->dispatch(); |
27
|
|
|
|
|
|
|
}; |
28
|
0
|
0
|
|
|
|
|
if( $@ ) { |
29
|
0
|
|
|
|
|
|
warn $@; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub prompt { |
34
|
0
|
|
|
0
|
0
|
|
my ( $self, $msg, $default ) = @_; |
35
|
0
|
|
0
|
|
|
|
$default ||= "Y"; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
print STDERR $msg; |
38
|
0
|
|
|
|
|
|
my $ans = ; |
39
|
0
|
|
|
|
|
|
chomp($ans); |
40
|
0
|
|
|
|
|
|
$ans =~ s{[\r\n]}{}g; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
0
|
|
|
|
$ans ||= $default; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return $ans; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub logger { |
49
|
0
|
|
|
0
|
0
|
|
return App::I18N->logger(); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |