Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
a7b743e1
Commit
a7b743e1
authored
7 years ago
by
Matthieu Schaller
Committed by
Peter W. Draper
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Be verbose when the YAML parameters are overwritten by a -P command-line argument.
parent
e5196580
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!402
Yamling
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/main.c
+5
-1
5 additions, 1 deletion
examples/main.c
src/parser.c
+2
-0
2 additions, 0 deletions
src/parser.c
with
7 additions
and
1 deletion
examples/main.c
+
5
−
1
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);
...
...
This diff is collapsed.
Click to expand it.
src/parser.c
+
2
−
0
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment