enh(collection): can use constant options (#3148)

This commit is contained in:
qgarnier 2021-09-27 14:51:07 +02:00 committed by GitHub
parent c1b56cafe3
commit a9fde00911
2 changed files with 8 additions and 8 deletions

View File

@ -774,10 +774,10 @@ sub set_constants {
my ($self, %options) = @_;
my $constants = {};
return $constants if (!defined($self->{config}->{constants}));
foreach (keys %{$self->{config}->{constants}}) {
$constants->{'constants.' . $_} = $self->{config}->{constants}->{$_};
if (defined($self->{config}->{constants})) {
foreach (keys %{$self->{config}->{constants}}) {
$constants->{'constants.' . $_} = $self->{config}->{constants}->{$_};
}
}
foreach (keys %{$self->{option_results}->{constant}}) {
$constants->{'constants.' . $_} = $self->{option_results}->{constant}->{$_};

View File

@ -710,10 +710,10 @@ sub set_constants {
my ($self, %options) = @_;
my $constants = {};
return $constants if (!defined($self->{config}->{constants}));
foreach (keys %{$self->{config}->{constants}}) {
$constants->{'constants.' . $_} = $self->{config}->{constants}->{$_};
if (defined($self->{config}->{constants})) {
foreach (keys %{$self->{config}->{constants}}) {
$constants->{'constants.' . $_} = $self->{config}->{constants}->{$_};
}
}
foreach (keys %{$self->{option_results}->{constant}}) {
$constants->{'constants.' . $_} = $self->{option_results}->{constant}->{$_};