line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
114688
|
use strict; |
|
11
|
|
|
|
|
34
|
|
|
11
|
|
|
|
|
357
|
|
2
|
11
|
|
|
11
|
|
47
|
use warnings; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
548
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::CommandOptionsFactory; |
5
|
|
|
|
|
|
|
$Footprintless::CommandOptionsFactory::VERSION = '1.29'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A factory for creating command options |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::CommandOptionsFactory |
8
|
|
|
|
|
|
|
|
9
|
11
|
|
|
11
|
|
74
|
use Carp; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
601
|
|
10
|
11
|
|
|
11
|
|
2275
|
use Footprintless::Localhost; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
283
|
|
11
|
11
|
|
|
11
|
|
849
|
use Footprintless::Command; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
2520
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
24
|
|
|
24
|
1
|
2550
|
return bless( {}, shift )->_init(@_); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub command_options { |
18
|
35
|
|
|
35
|
1
|
198
|
my ( $self, %options ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
35
|
100
|
|
|
|
139
|
$options{ssh} = $self->{default_ssh} unless ( $options{ssh} ); |
21
|
35
|
100
|
|
|
|
112
|
delete( $options{sudo_username} ) unless ( $options{sudo_username} ); |
22
|
35
|
50
|
|
|
|
101
|
delete( $options{sudo_command} ) unless ( $options{sudo_command} ); |
23
|
35
|
50
|
|
|
|
99
|
delete( $options{username} ) unless ( $options{username} ); |
24
|
35
|
100
|
66
|
|
|
375
|
if ( $self->{localhost} |
|
|
|
100
|
|
|
|
|
25
|
|
|
|
|
|
|
&& $options{hostname} |
26
|
|
|
|
|
|
|
&& $self->{localhost}->is_alias( $options{hostname} ) ) |
27
|
|
|
|
|
|
|
{ |
28
|
14
|
|
|
|
|
37
|
delete( $options{hostname} ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
35
|
|
|
|
|
216
|
return Footprintless::Command::command_options(%options); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _init { |
35
|
24
|
|
|
24
|
|
90
|
my ( $self, %options ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$self->{localhost} = $options{localhost} |
38
|
24
|
|
66
|
|
|
136
|
|| Footprintless::Localhost->new()->load_all(); |
39
|
24
|
|
100
|
|
|
150
|
$self->{default_ssh} = $options{default_ssh} || 'ssh -q'; |
40
|
|
|
|
|
|
|
|
41
|
24
|
|
|
|
|
90
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |