ENH: support usage descriptions for command arguments

This commit is contained in:
Mark Olesen
2018-12-12 11:58:56 +01:00
parent c3b6c787a7
commit f38190213c
49 changed files with 256 additions and 110 deletions

View File

@ -350,7 +350,11 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
argList::addArgument("featureAngle [0..180]");
argList::addArgument
(
"featureAngle",
"in degrees [0-180]"
);
argList::addOption
(
"concaveAngle",
@ -360,7 +364,7 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"meshQuality",
"Read user-defined mesh quality criterions from system/meshQualityDict"
"Read user-defined mesh quality criteria from system/meshQualityDict"
);
argList::noFunctionObjects(); // Never use function objects
@ -411,7 +415,7 @@ int main(int argc, char *argv[])
IOobject::MUST_READ,
IOobject::NO_WRITE
)
)
)
);
}

View File

@ -31,7 +31,7 @@ Description
Refine cells next to specified patches.
Arguments:
1: List of patch name regular expressions
1: List of patch names or regular expressions
2: The size of the refined cells as a fraction of the edge-length.
Examples:
@ -63,13 +63,21 @@ int main(int argc, char *argv[])
{
argList::addNote
(
"Refine cells next to specified patches.\n"
"The list of patches may contain regular expressions.\n"
"Refine cells next to specified patches."
);
#include "addOverwriteOption.H"
argList::addArgument("patches");
argList::addArgument("edgeFraction");
argList::addArgument
(
"patches",
"The list of patch names or regex - Eg, '(top \"Wall.\")'"
);
argList::addArgument
(
"edgeFraction",
"The size of the refined cells as a fraction of the edge-length"
" on a (0,1) interval"
);
argList::addOption
(

View File

@ -526,7 +526,11 @@ int main(int argc, char *argv[])
);
#include "addOverwriteOption.H"
argList::noParallel();
argList::addArgument("edgeAngle [0..360]");
argList::addArgument
(
"edgeAngle",
"in degrees [0-360]"
);
argList::addOption
(

View File

@ -99,7 +99,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::addArgument("ccmMesh");
argList::addArgument("ccm-file", "The input .ccm or .ccmg file");
argList::addBoolOption
(
"ascii",

View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::addArgument("firePolyMesh");
argList::addArgument("firePolyMesh", "The input FIRE mesh");
argList::addBoolOption
(
"ascii",

View File

@ -61,7 +61,8 @@ int main(int argc, char *argv[])
"Extract boundaries from an OpenFOAM mesh and write in a surface format"
);
argList::noParallel();
argList::addArgument("outputFile.ext");
argList::addArgument("output", "The output surface file");
timeSelector::addOptions();
argList::addOption

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::addArgument("PROSTAR prefix");
argList::addArgument("prefix", "The prefix for the input PROSTAR files");
argList::addBoolOption
(
"ascii",

View File

@ -106,7 +106,7 @@ int main(int argc, char *argv[])
"Convert tetgen .ele and .node and .face files to an OpenFOAM mesh"
);
argList::addArgument("file prefix");
argList::addArgument("prefix", "The prefix for the input tetgen files");
argList::addBoolOption
(
"noFaceFile",

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::addArgument(".vtk ascii file");
argList::addArgument("vtk-file", "The input legacy ascii vtk file");
#include "setRootCase.H"
#include "createTime.H"

View File

@ -369,7 +369,7 @@ int main(int argc, char *argv[])
"Re-sample surfaces used in foamyHexMesh operation"
);
argList::addArgument("outputName");
argList::addArgument("output", "The output triSurface/ file");
argList::noFunctionObjects(); // Never use function objects

View File

@ -53,8 +53,8 @@ int main(int argc, char *argv[])
(
"Re-sample surfaces used in foamyHexMesh operation"
);
argList::addArgument("(nx ny nz)");
argList::addArgument("outputName");
argList::addArgument("(nx ny nz)", "The resampling interval");
argList::addArgument("output", "The output triSurface/ file");
argList::noFunctionObjects(); // Never use function objects

View File

@ -83,7 +83,7 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::noFunctionObjects(); // Never use function objects
argList::addArgument("feature angle[0-180]");
argList::addArgument("featureAngle", "in degrees [0-180]");
#include "setRootCase.H"
#include "createTime.H"

View File

@ -50,7 +50,7 @@ int main(int argc, char *argv[])
" supplied as an argument"
);
argList::addArgument("scaling factor");
argList::addArgument("factor", "The deformation scaling factor");
#include "setRootCase.H"

View File

@ -116,8 +116,8 @@ int main(int argc, char *argv[])
);
argList::noParallel();
argList::addArgument("OBJ file");
argList::addArgument("output VTK file");
argList::addArgument("obj-file", "The input obj line file");
argList::addArgument("vtk-file", "The output vtk file");
argList args(argc, argv);
const fileName objName = args[1];

View File

@ -28,7 +28,7 @@ Group
grpMeshManipulationUtilities
Description
Corrects teh orientation of faceZone.
Corrects the orientation of faceZone.
- correct in parallel - excludes coupled faceZones from walk
- correct for non-manifold faceZones - restarts walk
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
);
#include "addRegionOption.H"
argList::addArgument("faceZone");
argList::addArgument("outsidePoint");
argList::addArgument("point", "A point outside of the mesh");
#include "setRootCase.H"
#include "createTime.H"

View File

@ -368,7 +368,12 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
argList::noParallel();
argList::addArgument("featureAngle [0-180]");
argList::addArgument
(
"featureAngle",
"in degrees [0-180]"
);
argList::addBoolOption
(
"splitAllFaces",

View File

@ -72,13 +72,13 @@ int main(int argc, char *argv[])
argList::addNote
(
"Rotate mesh points and vector/tensor fields\n"
"Rotation from the <n1> vector to the <n2> vector"
"Rotation from the <from> vector to the <to> vector"
);
timeSelector::addOptions();
argList::addArgument("n1");
argList::addArgument("n2");
argList::addArgument("from", "The vector to rotate from");
argList::addArgument("to", "The vector to rotate to");
#include "setRootCase.H"
#include "createTime.H"

View File

@ -123,9 +123,9 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
argList::addArgument("faceSet");
argList::addArgument("masterPatch");
argList::addArgument("slavePatch");
argList::addArgument("faceSet", "The faces used for splitting");
argList::addArgument("master", "The master patch name");
argList::addArgument("slave", "The slave patch name");
#include "setRootCase.H"
#include "createTime.H"

View File

@ -145,8 +145,16 @@ int main(int argc, char *argv[])
);
// The arguments are non-mandatory when using dictionary mode
argList::addArgument("masterPatch");
argList::addArgument("slavePatch");
argList::addArgument
(
"master",
"The master patch name (non-dictionary mode)"
);
argList::addArgument
(
"slave",
"The slave patch name (non-dictionary mode)"
);
#include "setRootCaseNonMandatoryArgs.H"