| 1 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | package Footprintless::CommandOptionsFactory; | ||||||||||||||||||||||||||||||||||||||||||
| 5 | 11 | $Footprintless::CommandOptionsFactory::VERSION = '1.29'; | |||||||||||||||||||||||||||||||||||||||||
| 6 | # ABSTRACT: A factory for creating command options | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # PODNAME: Footprintless::CommandOptionsFactory | ||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 11 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 11 | ▶ | use Footprintless::Localhost; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 11 | ▶ | use Footprintless::Command; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 24 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 24 | return bless( {}, shift )->_init(@_); | |||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 35 | ▶ | sub command_options { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
command_options: called CC=8 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 35 | my ( $self, %options ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 35 | ▶ | $options{ssh} = $self->{default_ssh} unless ( $options{ssh} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 35 | ▶ | delete( $options{sudo_username} ) unless ( $options{sudo_username} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 35 | ▶ | delete( $options{sudo_command} ) unless ( $options{sudo_command} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 35 | ▶ | delete( $options{username} ) unless ( $options{username} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 35 | ▶ | if ( $self->{localhost} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$self->{"localhost"} and $options{"hostname"} and $self->{"localhost"}->is_alias($options{"hostname"})
$self->{"localhost"} and $options{"hostname"}
MC/DC66%2/3
$self->{"localhost"} and $options{"hostname"} and $self->{"localhost"}->is_alias($options{"hostname"})
$self->{"localhost"}
$options{"hostname"}
$self->{"localhost"}->is_alias($options{"hostname"})
Truth table75%3/4
A and B and C
A= $self->{"localhost"}B= $options{"hostname"}C= $self->{"localhost"}->is_alias($options{"hostname"})
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | && $options{hostname} | ||||||||||||||||||||||||||||||||||||||||||
| 26 | && $self->{localhost}->is_alias( $options{hostname} ) ) | ||||||||||||||||||||||||||||||||||||||||||
| 27 | { | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 14 | delete( $options{hostname} ); | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 35 | return Footprintless::Command::command_options(%options); | |||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 24 | ▶ | sub _init { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 24 | my ( $self, %options ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | $self->{localhost} = $options{localhost} | ||||||||||||||||||||||||||||||||||||||||||
| 38 | 24 | ▶ | || Footprintless::Localhost->new()->load_all(); | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$options{'localhost'} || 'Footprintless::Localhost'->new->load_all
MC/DC0%0/2
$options{'localhost'} || 'Footprintless::Localhost'->new->load_all
$options{'localhost'}
'Footprintless::Localhost'->new->load_all
Truth table66%2/3
A || B
A= $options{'localhost'}B= 'Footprintless::Localhost'->new->load_all
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 24 | ▶ | $self->{default_ssh} = $options{default_ssh} || 'ssh -q'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$options{'default_ssh'} || 'ssh -q'
MC/DC100%1/1
$options{'default_ssh'} || 'ssh -q'
$options{'default_ssh'}
Truth table100%2/2
A
A= $options{'default_ssh'}
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 24 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | 11 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | __END__ | ||||||||||||||||||||||||||||||||||||||||||