Commit 04b3e6fc authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

don't mix missing and incomplete options in the report

parent 389911cd
......@@ -129,7 +129,8 @@ sub hash_leaves {
$self->hash_leaves($hash_to, $element, $array_element_prefix);
}
} elsif(!$self->is_fully_substituted_string($source)) {
$hash_to->{$prefix} = 1;
$source =~ m/#\:subst (.+?)\:#/;
$hash_to->{$prefix} = $prefix =~ /'$1'/ ? undef : $1;
}
return $hash_to;
......@@ -252,9 +253,15 @@ sub process_options {
my $missing_options = $self->hash_leaves( {}, $self->root, '' );
if(scalar(keys %$missing_options)) {
warn "Missing or incomplete definition of the following options:\n";
foreach my $key (sort keys %$missing_options) {
print "\t$key\n";
my @missing_keys = grep {!defined $missing_options->{$_}} (keys %$missing_options);
my @incomplete_keys = grep {defined $missing_options->{$_}} (keys %$missing_options);
if (@missing_keys) {
warn "The following options are missing:\n";
print "\t$_\n" for @missing_keys;
}
if (@incomplete_keys) {
warn "The following options are incomplete:\n";
print "\t$_ needs '".($missing_options->{$_})."'\n" for @incomplete_keys;
}
exit(1);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment