Commit 58b7e641 authored by Mark Olesen's avatar Mark Olesen
Browse files

Use argList::addOption, argList::addBoolOption (almost) everywhere

- ensure that the standard options (eg, from timeSelector) also have
  some usage information
parent ca7acea5
......@@ -38,11 +38,9 @@ Description
int main(int argc, char *argv[])
{
argList::validOptions.insert("writep", "");
argList::addBoolOption("writep", "write the final pressure field");
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
......
......@@ -42,7 +42,7 @@ Description
int main(int argc, char *argv[])
{
argList::validOptions.insert("cloudName", "cloud name");
argList::addOption("cloudName", "cloud name");
#include "setRootCase.H"
#include "createTime.H"
......
......@@ -47,11 +47,11 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("reList", "reList");
argList::validOptions.insert("wordList", "wordList");
argList::validOptions.insert("stringList", "stringList");
argList::validOptions.insert("float", "xx");
argList::validOptions.insert("flag", "");
argList::addOption("reList", "reList");
argList::addOption("wordList", "wordList");
argList::addOption("stringList", "stringList");
argList::addOption("float", "xx");
argList::addBoolOption("flag");
# include "setRootCase.H"
......
......@@ -82,9 +82,9 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::validArgs.insert("file .. fileN");
argList::validOptions.insert("mask", "");
argList::validOptions.insert("count", "");
argList::validOptions.insert("info", "");
argList::addBoolOption("mask");
argList::addBoolOption("count");
argList::addBoolOption("info");
argList args(argc, argv, false, true);
......
......@@ -98,8 +98,9 @@ bool checkDictionaryContent(const dictionary& dict1, const dictionary& dict2)
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("rewrite", "");
argList::validOptions.insert("show", "");
argList::addBoolOption("rewrite");
argList::addBoolOption("show");
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
......
......@@ -39,8 +39,9 @@ int main(int argc, char *argv[])
argList::noBanner();
argList::noParallel();
argList::validArgs.insert("file .. fileN");
argList::validOptions.erase("case");
argList::validOptions.insert("ext", "bak");
argList::removeOption("case");
argList::addOption("ext", "bak");
argList args(argc, argv, false, true);
......
......@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
{
argList::validArgs.clear();
argList::validArgs.append("CHEMKINIIIFile");
argList::validOptions.insert("thermo", "fileName");
argList::addOption("thermo", "fileName");
argList args(argc, argv);
fileName thermoFileName = fileName::null;
......
......@@ -44,8 +44,8 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.insert("string .. stringN");
argList::validOptions.insert("file", "name");
argList::validOptions.insert("repeat", "count");
argList::addOption("file", "name");
argList::addOption("repeat", "count");
argList args(argc, argv, false, true);
......
......@@ -454,7 +454,7 @@ label simplifyFaces
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("overwrite", "");
argList::addBoolOption("overwrite");
argList::validArgs.append("edge length [m]");
argList::validArgs.append("merge angle (degrees)");
......
......@@ -429,9 +429,9 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
int main(int argc, char *argv[])
{
argList::validArgs.append("feature angle [0..180]");
argList::validOptions.insert("concaveAngle", "[0..180]");
argList::validOptions.insert("snapMesh", "");
argList::validOptions.insert("overwrite", "");
argList::addOption("concaveAngle", "[0..180]");
argList::addBoolOption("snapMesh");
argList::addBoolOption("overwrite");
# include "setRootCase.H"
# include "createTime.H"
......
......@@ -328,7 +328,7 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
int main(int argc, char *argv[])
{
argList::validOptions.insert("overwrite", "");
argList::addBoolOption("overwrite");
# include "setRootCase.H"
# include "createTime.H"
......
......@@ -52,7 +52,7 @@ using namespace Foam;
// Main program:
int main(int argc, char *argv[])
{
argList::validOptions.insert("overwrite", "");
argList::addBoolOption("overwrite");
argList::validArgs.append("cellSet");
# include "setRootCase.H"
# include "createTime.H"
......
......@@ -47,11 +47,12 @@ using namespace Foam;
int main(int argc, char *argv[])
{
Foam::argList::noParallel();
Foam::argList::validArgs.append("patchName");
Foam::argList::validArgs.append("edgeWeight");
Foam::argList::validOptions.insert("useSet", "cellSet");
Foam::argList::validOptions.insert("overwrite", "");
argList::noParallel();
argList::validArgs.append("patchName");
argList::validArgs.append("edgeWeight");
argList::addOption("useSet", "cellSet");
argList::addBoolOption("overwrite");
# include "setRootCase.H"
# include "createTime.H"
......
......@@ -97,7 +97,7 @@ bool limitRefinementLevel
int main(int argc, char *argv[])
{
argList::validOptions.insert("readLevel", "");
argList::addBoolOption("readLevel");
# include "setRootCase.H"
# include "createTime.H"
......
......@@ -48,8 +48,8 @@ using namespace Foam;
int main(int argc, char *argv[])
{
Foam::argList::validOptions.insert("overwrite", "");
Foam::argList::validArgs.append("faceSet");
argList::addBoolOption("overwrite");
argList::validArgs.append("faceSet");
# include "setRootCase.H"
# include "createTime.H"
......
......@@ -525,10 +525,10 @@ void collectCuts
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("set", "cellSet name");
argList::validOptions.insert("geometry", "");
argList::validOptions.insert("tol", "edge snap tolerance");
argList::validOptions.insert("overwrite", "");
argList::addOption("set", "cellSet name");
argList::addBoolOption("geometry");
argList::addOption("tol", "edge snap tolerance");
argList::addBoolOption("overwrite");
argList::validArgs.append("edge angle [0..360]");
# include "setRootCase.H"
......
......@@ -238,7 +238,7 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("ANSYS input file");
argList::validOptions.insert("scale", "scale factor");
argList::addOption("scale", "scale factor");
argList args(argc, argv);
......
......@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("CFX geom file");
argList::validOptions.insert("scale", "scale factor");
argList::addOption("scale", "scale factor");
argList args(argc, argv);
......
......@@ -762,10 +762,10 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("Fluent mesh file");
argList::validOptions.insert("scale", "scale factor");
argList::validOptions.insert("ignoreCellGroups", "cell group names");
argList::validOptions.insert("ignoreFaceGroups", "face group names");
argList::validOptions.insert("cubit", "");
argList::addOption("scale", "scale factor");
argList::addOption("ignoreCellGroups", "cell group names");
argList::addOption("ignoreFaceGroups", "face group names");
argList::addBoolOption("cubit");
argList args(argc, argv);
......
......@@ -867,9 +867,9 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("Fluent mesh file");
argList::validOptions.insert("scale", "scale factor");
argList::validOptions.insert("writeSets", "");
argList::validOptions.insert("writeZones", "");
argList::addOption("scale", "scale factor");
argList::addBoolOption("writeSets");
argList::addBoolOption("writeZones");
argList args(argc, argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment