line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
80633
|
use strict; |
|
11
|
|
|
|
|
44
|
|
|
11
|
|
|
|
|
295
|
|
2
|
11
|
|
|
11
|
|
57
|
use warnings; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
478
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::CommandOptionsFactory; |
5
|
|
|
|
|
|
|
$Footprintless::CommandOptionsFactory::VERSION = '1.26'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A factory for creating command options |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::CommandOptionsFactory |
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
59
|
use Carp; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
541
|
|
10
|
11
|
|
|
11
|
|
1572
|
use Footprintless::Localhost; |
|
11
|
|
|
|
|
27
|
|
|
11
|
|
|
|
|
264
|
|
11
|
11
|
|
|
11
|
|
597
|
use Footprintless::Command; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
1963
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
24
|
|
|
24
|
1
|
2087
|
return bless( {}, shift )->_init(@_); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub command_options { |
18
|
35
|
|
|
35
|
1
|
159
|
my ( $self, %options ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
35
|
100
|
|
|
|
129
|
$options{ssh} = $self->{default_ssh} unless ( $options{ssh} ); |
21
|
35
|
100
|
|
|
|
105
|
delete( $options{sudo_username} ) unless ( $options{sudo_username} ); |
22
|
35
|
50
|
|
|
|
102
|
delete( $options{sudo_command} ) unless ( $options{sudo_command} ); |
23
|
35
|
50
|
|
|
|
94
|
delete( $options{username} ) unless ( $options{username} ); |
24
|
35
|
100
|
66
|
|
|
271
|
if ( $self->{localhost} |
|
|
|
100
|
|
|
|
|
25
|
|
|
|
|
|
|
&& $options{hostname} |
26
|
|
|
|
|
|
|
&& $self->{localhost}->is_alias( $options{hostname} ) ) |
27
|
|
|
|
|
|
|
{ |
28
|
14
|
|
|
|
|
41
|
delete( $options{hostname} ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
35
|
|
|
|
|
209
|
return Footprintless::Command::command_options(%options); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _init { |
35
|
24
|
|
|
24
|
|
79
|
my ( $self, %options ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$self->{localhost} = $options{localhost} |
38
|
24
|
|
66
|
|
|
137
|
|| Footprintless::Localhost->new()->load_all(); |
39
|
24
|
|
100
|
|
|
131
|
$self->{default_ssh} = $options{default_ssh} || 'ssh -q'; |
40
|
|
|
|
|
|
|
|
41
|
24
|
|
|
|
|
78
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |