line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
89878
|
use strict; |
|
11
|
|
|
|
|
35
|
|
|
11
|
|
|
|
|
280
|
|
2
|
11
|
|
|
11
|
|
49
|
use warnings; |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
487
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::CommandOptionsFactory; |
5
|
|
|
|
|
|
|
$Footprintless::CommandOptionsFactory::VERSION = '1.28'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A factory for creating command options |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::CommandOptionsFactory |
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
51
|
use Carp; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
560
|
|
10
|
11
|
|
|
11
|
|
2510
|
use Footprintless::Localhost; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
257
|
|
11
|
11
|
|
|
11
|
|
806
|
use Footprintless::Command; |
|
11
|
|
|
|
|
27
|
|
|
11
|
|
|
|
|
2167
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
24
|
|
|
24
|
1
|
2452
|
return bless( {}, shift )->_init(@_); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub command_options { |
18
|
35
|
|
|
35
|
1
|
168
|
my ( $self, %options ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
35
|
100
|
|
|
|
117
|
$options{ssh} = $self->{default_ssh} unless ( $options{ssh} ); |
21
|
35
|
100
|
|
|
|
97
|
delete( $options{sudo_username} ) unless ( $options{sudo_username} ); |
22
|
35
|
50
|
|
|
|
79
|
delete( $options{sudo_command} ) unless ( $options{sudo_command} ); |
23
|
35
|
50
|
|
|
|
77
|
delete( $options{username} ) unless ( $options{username} ); |
24
|
35
|
100
|
66
|
|
|
260
|
if ( $self->{localhost} |
|
|
|
100
|
|
|
|
|
25
|
|
|
|
|
|
|
&& $options{hostname} |
26
|
|
|
|
|
|
|
&& $self->{localhost}->is_alias( $options{hostname} ) ) |
27
|
|
|
|
|
|
|
{ |
28
|
14
|
|
|
|
|
31
|
delete( $options{hostname} ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
35
|
|
|
|
|
157
|
return Footprintless::Command::command_options(%options); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _init { |
35
|
24
|
|
|
24
|
|
99
|
my ( $self, %options ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$self->{localhost} = $options{localhost} |
38
|
24
|
|
66
|
|
|
131
|
|| Footprintless::Localhost->new()->load_all(); |
39
|
24
|
|
100
|
|
|
167
|
$self->{default_ssh} = $options{default_ssh} || 'ssh -q'; |
40
|
|
|
|
|
|
|
|
41
|
24
|
|
|
|
|
111
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |