ENH: Added displayDocOptions for default behaviour when no arg specified

This commit is contained in:
andy
2012-08-16 14:50:13 +01:00
parent df91d1349f
commit 0c081688ee
4 changed files with 65 additions and 0 deletions

View File

@ -179,6 +179,13 @@ void Foam::helpTypes::helpBoundary::execute
<< "-field option must be specified when using the -fixedValue "
<< "option" << exit(FatalError);
}
else
{
// TODO: strip scoping info if present?
// e.g. conditions with leading "compressible::" will not be found
// ".*[fF]vPatchField.*" + className + ".*"
displayDocOptions(".*[fF]vPatchField.*", false);
}
}

View File

@ -78,6 +78,10 @@ void Foam::helpTypes::helpFunctionObject::execute
{
displayDoc(function, ".*[fF]unctionObject.*", true);
}
else
{
displayDocOptions(".*[fF]unctionObject.*", true);
}
}

View File

@ -37,6 +37,53 @@ namespace Foam
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::helpType::displayDocOptions
(
const string& searchStr,
const bool exactMatch
) const
{
const dictionary& docDict = debug::controlDict().subDict("Documentation");
List<fileName> docDirs(docDict.lookup("doxyDocDirs"));
label i = -1;
forAll(docDirs, dirI)
{
if (isDir(docDirs[dirI].expand()))
{
i = dirI;
break;
}
}
if (i != -1)
{
Info<< "Found doxygen help in " << docDirs[i].c_str() << nl << endl;
string docBrowser = getEnv("FOAM_DOC_BROWSER");
if (docBrowser.empty())
{
docDict.lookup("docBrowser") >> docBrowser;
}
doxygenXmlParser parser
(
docDirs[i]/"../DTAGS",
"tagfile",
searchStr,
exactMatch
);
Info<< "Valid types include:" << nl << SortableList<word>(parser.toc());
}
else
{
Info<< "No Doxygen sources found under search paths: "
<< docDirs << endl;
}
}
void Foam::helpType::displayDoc
(
const word& className,

View File

@ -58,6 +58,13 @@ class helpType
protected:
//- Display the list of documentation options
void displayDocOptions
(
const string& searchStr,
const bool exactMatch
) const;
//- Display the help documentation in a browser
void displayDoc
(