Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Development
openfoam
Commits
29bff520
Commit
29bff520
authored
9 years ago
by
Henry Weller
Browse files
Options
Downloads
Patches
Plain Diff
foamDictionary: Added -value option to print the value associated with an entry
parent
2f847697
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/miscellaneous/foamDictionary/foamDictionary.C
+28
-4
28 additions, 4 deletions
...s/utilities/miscellaneous/foamDictionary/foamDictionary.C
with
28 additions
and
4 deletions
applications/utilities/miscellaneous/foamDictionary/foamDictionary.C
+
28
−
4
View file @
29bff520
...
@@ -242,19 +242,24 @@ int main(int argc, char *argv[])
...
@@ -242,19 +242,24 @@ int main(int argc, char *argv[])
argList
::
noBanner
();
argList
::
noBanner
();
argList
::
validArgs
.
append
(
"dictionary"
);
argList
::
validArgs
.
append
(
"dictionary"
);
argList
::
addBoolOption
(
"keywords"
,
"
repor
t keywords"
);
argList
::
addBoolOption
(
"keywords"
,
"
lis
t keywords"
);
argList
::
addOption
(
"entry"
,
"name"
,
"report/select the named entry"
);
argList
::
addOption
(
"entry"
,
"name"
,
"report/select the named entry"
);
argList
::
addBoolOption
(
"value"
,
"print entry value"
);
argList
::
addOption
argList
::
addOption
(
(
"set"
,
"set"
,
"value"
,
"value"
,
"
changes existing
entry or add
s
new entry"
"
set
entry
value
or add new entry"
);
);
argList
::
addOption
argList
::
addOption
(
(
"add"
,
"add"
,
"value"
,
"value"
,
"add
s
a new entry"
"add a new entry"
);
);
argList
::
addBoolOption
argList
::
addBoolOption
(
(
...
@@ -356,7 +361,26 @@ int main(int argc, char *argv[])
...
@@ -356,7 +361,26 @@ int main(int argc, char *argv[])
}
}
else
else
{
{
Info
<<
*
entPtr
<<
endl
;
if
(
args
.
optionFound
(
"value"
))
{
if
(
entPtr
->
isStream
())
{
const
tokenList
&
tokens
=
entPtr
->
stream
();
forAll
(
tokens
,
i
)
{
Info
<<
tokens
[
i
]
<<
token
::
SPACE
;
}
Info
<<
endl
;
}
else
if
(
entPtr
->
isDict
())
{
Info
<<
entPtr
->
dict
();
}
}
else
{
Info
<<
*
entPtr
<<
endl
;
}
}
}
}
}
else
else
...
...
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