mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: argList option to remove the noFunctionObjects option (issue #352)
This commit is contained in:
@ -158,6 +158,21 @@ void Foam::argList::noBanner()
|
||||
}
|
||||
|
||||
|
||||
void Foam::argList::noFunctionObjects(bool addWithOption)
|
||||
{
|
||||
removeOption("noFunctionObjects");
|
||||
|
||||
if (addWithOption)
|
||||
{
|
||||
addBoolOption
|
||||
(
|
||||
"withFunctionObjects",
|
||||
"execute functionObjects"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::argList::noParallel()
|
||||
{
|
||||
removeOption("parallel");
|
||||
@ -459,6 +474,9 @@ Foam::argList::argList
|
||||
)
|
||||
)
|
||||
{
|
||||
// If the option is known to require an argument,
|
||||
// get it or emit a FatalError.
|
||||
|
||||
++argI;
|
||||
if (argI >= args_.size())
|
||||
{
|
||||
@ -475,6 +493,9 @@ Foam::argList::argList
|
||||
}
|
||||
else
|
||||
{
|
||||
// All other options (including unknown ones) are simply
|
||||
// registered as existing.
|
||||
|
||||
options_.insert(optionName, "");
|
||||
}
|
||||
}
|
||||
@ -527,29 +548,31 @@ void Foam::argList::parse
|
||||
// -help print the usage
|
||||
// -doc display application documentation in browser
|
||||
// -srcDoc display source code in browser
|
||||
if
|
||||
(
|
||||
options_.found("help")
|
||||
|| options_.found("doc")
|
||||
|| options_.found("srcDoc")
|
||||
)
|
||||
{
|
||||
bool quickExit = false;
|
||||
|
||||
if (options_.found("help"))
|
||||
{
|
||||
printUsage();
|
||||
quickExit = true;
|
||||
}
|
||||
|
||||
// Only display one or the other
|
||||
if (options_.found("srcDoc"))
|
||||
{
|
||||
displayDoc(true);
|
||||
quickExit = true;
|
||||
}
|
||||
else if (options_.found("doc"))
|
||||
{
|
||||
displayDoc(false);
|
||||
quickExit = true;
|
||||
}
|
||||
|
||||
::exit(0);
|
||||
if (quickExit)
|
||||
{
|
||||
::exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Print the usage message and exit if the number of arguments is incorrect
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -348,6 +348,10 @@ public:
|
||||
//- Disable emitting the banner information
|
||||
static void noBanner();
|
||||
|
||||
//- Remove the 'noFunctionObjects' option,
|
||||
// optionally adding a 'withFunctionObjects' option instead
|
||||
static void noFunctionObjects(bool addWithOption = false);
|
||||
|
||||
//- Remove the parallel options
|
||||
static void noParallel();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user