PT-115 Made OptionParser to accept repeatable DSN parameters

This commit is contained in:
Carlos Salguero
2017-03-29 14:45:23 -03:00
parent 515833f3d2
commit e22e8f4b1d
26 changed files with 130 additions and 26 deletions

View File

@@ -678,7 +678,11 @@ sub _validate_type {
}
}
my $defaults = $self->{DSNParser}->parse_options($self);
$opt->{value} = $self->{DSNParser}->parse($val, $prev, $defaults);
if (!$opt->{attributes}->{repeatable}) {
$opt->{value} = $self->{DSNParser}->parse($val, $prev, $defaults);
} else {
push @{$opt->{value}}, $self->{DSNParser}->parse($val, $prev, $defaults);
}
}
elsif ( $val && $opt->{type} eq 'z' ) { # type size
PTDEBUG && _d('Parsing option', $opt->{long}, 'as a size value');