(dbi) handle multiple options for passwordmgr (#4211)
This commit is contained in:
parent
9a57d96c6e
commit
dd5194a7e6
|
@ -136,8 +136,15 @@ sub check_options {
|
|||
my ($self, %options) = @_;
|
||||
|
||||
$self->{data_source} = (defined($self->{option_results}->{data_source})) ? shift(@{$self->{option_results}->{data_source}}) : undef;
|
||||
$self->{username} = (defined($self->{option_results}->{username})) ? shift(@{$self->{option_results}->{username}}) : undef;
|
||||
$self->{password} = (defined($self->{option_results}->{password})) ? shift(@{$self->{option_results}->{password}}) : undef;
|
||||
$self->{username} = undef;
|
||||
if (defined($self->{option_results}->{username})) {
|
||||
$self->{username} = ref($self->{option_results}->{username}) eq 'ARRAY' ? shift(@{$self->{option_results}->{username}}) : $self->{option_results}->{username};
|
||||
}
|
||||
$self->{password} = undef;
|
||||
if (defined($self->{option_results}->{password})) {
|
||||
$self->{password} = ref($self->{option_results}->{password}) eq 'ARRAY' ? shift(@{$self->{option_results}->{password}}) : $self->{option_results}->{password};
|
||||
}
|
||||
|
||||
$self->{connect_options} = (defined($self->{option_results}->{connect_options})) ? shift(@{$self->{option_results}->{connect_options}}) : undef;
|
||||
$self->{connect_query} = (defined($self->{option_results}->{connect_query})) ? shift(@{$self->{option_results}->{connect_query}}) : undef;
|
||||
$self->{env} = (defined($self->{option_results}->{env})) ? shift(@{$self->{option_results}->{env}}) : undef;
|
||||
|
|
|
@ -223,7 +223,7 @@ sub do_map {
|
|||
while ($map =~ /\%\{(.*?)\}/g) {
|
||||
my $sub = '';
|
||||
$sub = $self->{lookup_values}->{$1} if (defined($self->{lookup_values}->{$1}));
|
||||
$map =~ s/\%\{$1\}/$sub/g
|
||||
$map =~ s/\%\{$1\}/$sub/g;
|
||||
}
|
||||
$option =~ s/-/_/g;
|
||||
$options{option_results}->{$option} = $map;
|
||||
|
|
Loading…
Reference in New Issue