ENH: foamHelp - minro refactoring to enable use of foamHelp -help option

This commit is contained in:
Andrew Heather
2017-06-08 16:07:58 +01:00
parent 40ddfb4277
commit c187e9b523
5 changed files with 20 additions and 8 deletions

View File

@ -0,0 +1,10 @@
argList::validArgs.append("tool");
const wordList opts(helpType::dictionaryConstructorTablePtr_->sortedToc());
string note = "Valid <tool> options include:";
forAll(opts, i)
{
note = note + ' ' + opts[i];
}
argList::notes.append(note);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,6 +42,14 @@ using namespace Foam;
int main(int argc, char *argv[])
{
#include "addRegionOption.H"
#include "addToolOption.H"
// Intercept request for help
if ((argc > 0) && (strcmp(argv[1], "-help") == 0))
{
#include "setRootCase.H"
}
if (argc < 2)
{
FatalError
@ -49,8 +57,7 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
const word utilityName = argv[1];
word utilityName = argv[1];
Foam::autoPtr<Foam::helpType> utility
(
helpType::New(utilityName)

View File

@ -62,8 +62,6 @@ void Foam::helpTypes::helpBoundary::init()
{
helpType::init();
argList::validArgs.append("boundary");
argList::addOption
(
"field",

View File

@ -61,8 +61,6 @@ Foam::helpTypes::helpFunctionObject::~helpFunctionObject()
void Foam::helpTypes::helpFunctionObject::init()
{
helpType::init();
argList::validArgs.append("functionObject");
}

View File

@ -63,7 +63,6 @@ void Foam::helpTypes::helpSolver::init()
{
helpType::init();
argList::validArgs.append("solver");
argList::addBoolOption
(
"read",