line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Tak; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
513137
|
use Moo; |
|
1
|
|
|
|
|
16123
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
has env => (is => 'ro', required => 1); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new_from_environment { |
8
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
9
|
0
|
|
|
|
|
|
my %env = ( |
10
|
|
|
|
|
|
|
env => { %ENV }, argv => [ @ARGV ], |
11
|
|
|
|
|
|
|
stdin => \*STDIN, stdout => \*STDOUT, stderr => \*STDERR |
12
|
|
|
|
|
|
|
); |
13
|
0
|
|
|
|
|
|
$class->new(env => \%env); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub run { |
17
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
18
|
0
|
|
|
|
|
|
my @argv = @{$self->env->{argv}}; |
|
0
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
require Tak::MyScript; |
20
|
0
|
|
|
|
|
|
my $opt = Tak::MyScript->_parse_options( |
21
|
|
|
|
|
|
|
'config|c=s;host|h=s@;local|l!;verbose|v+;quiet|q+', \@argv |
22
|
|
|
|
|
|
|
); |
23
|
0
|
|
|
|
|
|
Tak::MyScript->new( |
24
|
|
|
|
|
|
|
options => $opt, |
25
|
0
|
|
|
|
|
|
env => { %{$self->env}, argv => \@argv } |
26
|
|
|
|
|
|
|
)->run; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |