mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamHelp - minro refactoring to enable use of foamHelp -help option
This commit is contained in:
@ -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);
|
||||
@ -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)
|
||||
|
||||
@ -62,8 +62,6 @@ void Foam::helpTypes::helpBoundary::init()
|
||||
{
|
||||
helpType::init();
|
||||
|
||||
argList::validArgs.append("boundary");
|
||||
|
||||
argList::addOption
|
||||
(
|
||||
"field",
|
||||
|
||||
@ -61,8 +61,6 @@ Foam::helpTypes::helpFunctionObject::~helpFunctionObject()
|
||||
void Foam::helpTypes::helpFunctionObject::init()
|
||||
{
|
||||
helpType::init();
|
||||
|
||||
argList::validArgs.append("functionObject");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -63,7 +63,6 @@ void Foam::helpTypes::helpSolver::init()
|
||||
{
|
||||
helpType::init();
|
||||
|
||||
argList::validArgs.append("solver");
|
||||
argList::addBoolOption
|
||||
(
|
||||
"read",
|
||||
|
||||
Reference in New Issue
Block a user