Skip to content
Snippets Groups Projects
Commit c187e9b5 authored by Andrew Heather's avatar Andrew Heather
Browse files

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

parent 40ddfb42
Branches
Tags
No related merge requests found
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",
......
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