Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
a7b743e1
Commit
a7b743e1
authored
Aug 14, 2017
by
Matthieu Schaller
Committed by
Peter W. Draper
Aug 15, 2017
Browse files
Be verbose when the YAML parameters are overwritten by a -P command-line argument.
parent
e5196580
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
a7b743e1
...
...
@@ -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(¶ms);
...
...
src/parser.c
View file @
a7b743e1
...
...
@@ -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
(
"Using the value '%s' instead of '%s' for the parameter '%s'"
,
value
,
params
->
data
[
i
].
value
,
params
->
data
[
i
].
name
);
strcpy
(
params
->
data
[
i
].
value
,
value
);
updated
=
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment