Skip to content
Snippets Groups Projects
Commit 23710c75 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'yamling' into 'master'

Yamling

Warn when overriding parameters from the command-line.

See merge request !402
parents e5196580 c7692764
No related branches found
No related tags found
1 merge request!402Yamling
......@@ -396,8 +396,12 @@ int main(int argc, char *argv[]) {
parser_read_file(paramFileName, params);
/* Handle any command-line overrides. */
if (nparams > 0)
if (nparams > 0) {
message(
"Overwriting values read from the YAML file with command-line "
"values.");
for (int k = 0; k < nparams; k++) parser_set_param(params, cmdparams[k]);
}
/* And dump the parameters as used. */
// parser_print_params(&params);
......
......@@ -133,6 +133,8 @@ void parser_set_param(struct swift_params *params, const char *namevalue) {
int updated = 0;
for (int i = 0; i < params->paramCount; i++) {
if (strcmp(name, params->data[i].name) == 0) {
message("Value of '%s' changed from '%s' to '%s'",
params->data[i].name, params->data[i].value, value);
strcpy(params->data[i].value, value);
updated = 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment