Skip to content
Permalink
Browse files

foamDictionary: Added -merge option

which merges the new entry with the corresponding entry in the dictionary
  • Loading branch information...
Henry Weller
Henry Weller committed Dec 5, 2018
1 parent d6f538c commit abde9a8a7c6313d1678adc38581973ec12a22bd9
Showing with 12 additions and 1 deletion.
  1. +12 −1 applications/utilities/miscellaneous/foamDictionary/foamDictionary.C
@@ -43,6 +43,9 @@ Usage
- \par -set \<value\>
Adds or replaces the entry
- \par -merge \<value\>
Merges the entry
- \par -remove
Remove the selected entry
@@ -263,6 +266,12 @@ int main(int argc, char *argv[])
"value",
"Add a new entry"
);
argList::addOption
(
"merge",
"value",
"Merge entry"
);
argList::addBoolOption
(
"remove",
@@ -366,9 +375,11 @@ int main(int argc, char *argv[])
(
args.optionReadIfPresent("set", newValue)
|| args.optionReadIfPresent("add", newValue)
|| args.optionReadIfPresent("merge", newValue)
)
{
const bool overwrite = args.optionFound("set");
const bool merge = args.optionFound("merge");

Pair<word> dAk(dictAndKeyword(scopedName));

@@ -382,7 +393,7 @@ int main(int argc, char *argv[])
}
else
{
const_cast<dictionary&>(d).add(ePtr, false);
const_cast<dictionary&>(d).add(ePtr, merge);
}
changed = true;

0 comments on commit abde9a8

Please sign in to comment.
You can’t perform that action at this time.