Extract command arguments and options from the supplied argc and argv parameters. More...
#include <argList.H>

Public Member Functions | |
| argList (int &argc, char **&argv, bool checkArgs=argList::argsMandatory(), bool checkOpts=true, bool initialise=true) | |
| Construct from argc and argv checking the arguments and options as requested. | |
| argList (const argList &args, const HashTable< string > &options, bool checkArgs=true, bool checkOpts=true, bool initialise=true) | |
| Construct copy with new options. | |
| virtual | ~argList () |
| Destructor. | |
| void | parse (bool checkArgs, bool checkOpts, bool initialise) |
| Scan for -help, -doc options etc prior to checking the validity of other args/opts and finally initialising. | |
| const word & | executable () const noexcept |
| Name of executable without the path. | |
| const string & | commandLine () const noexcept |
| The command line options and arguments concatenated as a string. | |
| const fileName & | rootPath () const noexcept |
| Return root path. | |
| const fileName & | caseName () const noexcept |
| Return case name (parallel run) or global case (serial run). | |
| const fileName & | globalCaseName () const noexcept |
| Return global case name. | |
| fileName | path () const |
| Return the full path to the (processor local) case. | |
| fileName | globalPath () const |
| Return the full path to the global case. | |
| fileName | relativePath (const fileName &input, const bool caseTag=false) const |
| Return the input relative to the globalPath by stripping off a leading value of the globalPath. | |
| const ParRunControl & | runControl () const noexcept |
| Return the run control (parallel, dry-run etc). | |
| bool | distributed () const noexcept |
| Return distributed flag (i.e. are rootPaths different on different machines). | |
| int | dryRun () const noexcept |
| Return the dry-run flag. | |
| int | dryRun (const int level) noexcept |
| Modify the dry-run flag. | |
| int | verbose () const noexcept |
| Return the verbose flag. | |
| int | verbose (const int level) noexcept |
| Modify the verbose flag. | |
| bool | allowFunctionObjects () const |
| The controlDict 'functions' entry is allowed to be used. | |
| bool | allowLibs () const |
| The controlDict 'libs' entry is allowed to be used. (eg, has not been disabled by the -no-libs option). | |
| dlLibraryTable & | libs () const noexcept |
| Mutable access to the loaded dynamic libraries. | |
| label | size () const noexcept |
| The number of arguments. | |
| const stringList & | args () const noexcept |
| Return arguments. | |
| stringList & | args () noexcept |
| Non-const access to the command arguments (non-options). | |
| const HashTable< string > & | options () const noexcept |
| Return options. | |
| HashTable< string > & | options () noexcept |
| Return non-const access to the command options. | |
| bool | found (const word &optName) const |
| Return true if the named option is found. | |
| label | count (const UList< word > &optionNames) const |
| Return how many of the specified options were used. | |
| label | count (std::initializer_list< word > optionNames) const |
| Return how many of the specified options were used. | |
| ITstream | lookup (const word &optName) const |
| Return an input stream from the named option. | |
| template<class T> | |
| T | get (const label index) const |
| Get a value from the argument at index. | |
| template<class T> | |
| List< T > | getList (const label index) const |
| Get a List of values from the argument at index. | |
| template<class T = string> | |
| T | get (const word &optName) const |
| Get a value from the named option. | |
| template<class T> | |
| T | getOrDefault (const word &optName, const T &deflt) const |
| Get a value from the named option if present, or return default. | |
| template<class T> | |
| List< T > | getList (const word &optName, bool mandatory=true) const |
| Get a List of values from the named option, treating a single entry like a list of size 1. | |
| template<class T> | |
| bool | readIfPresent (const word &optName, T &val) const |
| Read a value from the named option if present. | |
| template<class T> | |
| bool | readIfPresent (const word &optName, T &val, const T &deflt) const |
| Read a value from the named option if present. | |
| template<class T> | |
| bool | readListIfPresent (const word &optName, List< T > &list) const |
| If named option is present, get a List of values treating a single entry like a list of size 1. | |
| template<class T, class Predicate> | |
| bool | readCheck (const word &optName, T &val, const Predicate &pred, bool mandatory=true) const |
| Read the named option and check its validity. | |
| template<class T, class Predicate> | |
| bool | readCheckIfPresent (const word &optName, T &val, const Predicate &pred) const |
| Read the named option if present and check its validity. | |
| template<class T, class Predicate> | |
| T | getCheck (const word &optName, const Predicate &pred) const |
| Get a value from the named option with additional checking. | |
| template<class T, class Predicate> | |
| T | getCheckOrDefault (const word &optName, const T &deflt, const Predicate &pred) const |
| Get a value from the named option with additional checking (if present), or return default. | |
| bool | setOption (const word &optName, const string ¶m="") |
| Set option directly (use with caution). | |
| bool | unsetOption (const word &optName) |
| Unset option directly (use with caution). | |
| void | printCompat () const |
| Print option compatibility. | |
| void | printNotes () const |
| Print notes (if any). | |
| void | printUsage (bool full=true) const |
| Print usage. | |
| void | printMan () const |
| Print usage as nroff-man format (Experimental). | |
| void | displayDoc (bool source=false) const |
| Display documentation in browser. | |
| bool | check (bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const |
| Check the parsed command-line for mandatory arguments and that all the options are correct. | |
| bool | checkRootCase () const |
| Check root path and case path. | |
| const string & | operator[] (const label index) const |
| The string corresponding to the argument index. | |
| const string & | operator[] (const word &optName) const |
| The string associated with the named option. | |
| template<class T = string> | |
| T | opt (const word &optName) const |
| Deprecated(2020-05) identical to get(const word& optName). | |
| template<class T> | |
| T | opt (const word &optName, const T &deflt) const |
| Deprecated(2020-05) identical to getOrDefault(...). | |
| template<class T> | |
| T | get (const word &optName, const T &deflt) const |
| Deprecated(2020-05) identical to getOrDefault(...). | |
| template<class T> | |
| T | lookupOrDefault (const word &optName, const T &deflt) const |
| Deprecated(2020-05) identical to getOrDefault(...). | |
| const ParRunControl & | parRunControl () const |
| Same as runControl() - v2106 and earlier. | |
| template<class T> | |
| T | read (const label index) const |
| Deprecated(2018-08) read a value from the argument at index. | |
| template<class T> | |
| T | argRead (const label index) const |
| Deprecated(2018-01) read a value from the argument at index. | |
| bool | optionFound (const word &optName) const |
| Deprecated(2018-01) return true if the named option is found. | |
| ITstream | optionLookup (const word &optName) const |
| Deprecated(2018-01) return an input stream from the named option. | |
| template<class T> | |
| T | optionRead (const word &optName) const |
| Deprecated(2018-01) read a value from the named option. | |
| template<class T> | |
| bool | optionReadIfPresent (const word &optName, T &val) const |
| Deprecated(2018-01) read a value from the named option if present. | |
| template<class T> | |
| bool | optionReadIfPresent (const word &optName, T &val, const T &deflt) const |
| Deprecated(2018-01) read a value from the named option if present. | |
| template<class T> | |
| T | optionLookupOrDefault (const word &optName, const T &deflt) const |
| Deprecated(2018-01) read a value from the named option if present. | |
| template<class T> | |
| List< T > | optionReadList (const word &optName) const |
| Deprecated(2018-01) read a List of values from the named option. | |
| template<> | |
| int32_t | get (const label index) const |
| template<> | |
| int64_t | get (const label index) const |
| template<> | |
| float | get (const label index) const |
| template<> | |
| double | get (const label index) const |
| template<> | |
| int32_t | get (const word &optName) const |
| template<> | |
| int64_t | get (const word &optName) const |
| template<> | |
| float | get (const word &optName) const |
| template<> | |
| double | get (const word &optName) const |
| template<class T> | |
| Foam::List< T > | getList (const label index) const |
| template<class T> | |
| Foam::List< T > | getList (const word &optName, bool mandatory) const |
Static Public Member Functions | |
| static word | envExecutable () |
| Name of the executable from environment variable. | |
| static fileName | envGlobalPath () |
| Global case (directory) from environment variable. | |
| static fileName | envRelativePath (const fileName &input, const bool caseTag=false) |
| Return the input relative to the globalPath by stripping off a leading value of the envGlobalPath. | |
| static void | addArgument (const string &argName, const string &usage="") |
| Append a (mandatory) argument to validArgs. | |
| static void | addBoolOption (const word &optName, const string &usage="", bool advanced=false) |
| Add a bool option to validOptions with usage information. | |
| static void | addOption (const word &optName, const string ¶m="", const string &usage="", bool advanced=false) |
| Add an option to validOptions with usage information. | |
| static void | setAdvanced (const word &optName, bool advanced=true) |
| Set an existing option as being 'advanced' or normal. | |
| static void | addOptionCompat (const word &optName, std::pair< const char *, int > compat) |
| Specify an alias for the option name. | |
| static void | ignoreOptionCompat (std::pair< const char *, int > compat, bool expectArg) |
| Specify an option to be ignored. | |
| static void | addUsage (const word &optName, const string &usage) |
| Add option usage information to optionUsage. | |
| static void | addNote (const string ¬e) |
| Add extra notes for the usage information. | |
| static void | removeOption (const word &optName) |
| Remove option from validOptions and from optionUsage. | |
| static void | noMandatoryArgs () |
| Flag command arguments as being optional (non-mandatory). | |
| static bool | argsMandatory () |
| Command arguments type (optional/mandatory). | |
| static void | noBanner () |
| Disable emitting the banner information. | |
| static bool | bannerEnabled () |
| Banner status (enabled/disabled). | |
| static void | addDryRunOption (const string &usage, bool advanced=false) |
| Enable a 'dry-run' bool option, with usage information. | |
| static void | addVerboseOption (const string &usage="", bool advanced=false) |
| Enable a 'verbose' bool option, with usage information. | |
| static void | noFunctionObjects (bool addWithOption=false) |
| Remove '-noFunctionObjects' option and ignore any occurrences. | |
| static void | noJobInfo () |
| Suppress JobInfo, overriding controlDict setting. | |
| static void | noLibs () |
| Add the '-no-libs' command line option. | |
| static void | noParallel () |
| Remove the parallel options. | |
| static void | noCheckProcessorDirectories () |
| Disable checking of processor directories. | |
| static void | parallelThreads_on () |
| MPI threads are desired for the application. | |
| static bool | postProcess (int argc, char *argv[]) |
True if the post-processing option is found in the argv list. | |
| static int | verbose (int argc, char *argv[]) |
The number of times -verbose is found in the argv list. | |
Static Public Attributes | |
| static SLList< string > | validArgs |
| A list of valid (mandatory) arguments. | |
| static HashSet< string > | advancedOptions |
| The "advanced" options are shown with -help-full (not with –help). | |
| static HashTable< string > | validOptions |
| A list of valid options. | |
| static HashTable< string > | validParOptions |
| A list of valid parallel options. | |
| static HashTable< std::pair< word, int > > | validOptionsCompat |
| A list of aliases for options. | |
| static HashTable< std::pair< bool, int > > | ignoreOptionsCompat |
| A list of options to ignore. | |
| static HashTable< string, label, Hash< label > > | argUsage |
| Short description for program arguments. | |
| static HashTable< string > | optionUsage |
| Short description for validOptions. | |
| static SLList< string > | notes |
| General usage notes. | |
| static std::string::size_type | usageMin = 20 |
| Min indentation when displaying usage (default: 20). | |
| static std::string::size_type | usageMax = 80 |
| Max screen width when displaying usage (default: 80). | |
| static word | postProcessOptionName |
| Standard name for the post-processing option. | |
Extract command arguments and options from the supplied argc and argv parameters.
Sequences with "(" ... ")" are transformed into a stringList. For example,
program -listFiles \( *.txt \)
would create a stringList:
( "file1.txt" "file2.txt" ... "fileN.txt" )
The backslash-escaping is required to avoid interpretation by the shell.
Default command-line options:
Environment variables set by argList or by Time:
application entry (from controlDict) if that entry is present.application entry is adjusted during runtime.| argList | ( | int & | argc, |
| char **& | argv, | ||
| bool | checkArgs = argList::argsMandatory(), | ||
| bool | checkOpts = true, | ||
| bool | initialise = true ) |
Construct from argc and argv checking the arguments and options as requested.
By default, the argument check respects the value of argsMandatory() to decide if the arguments should be checked (when they are mandatory) or not (when they are optional)
Definition at line 912 of file argList.C.
References Foam::debug::debugObjects(), Foam::Info, Foam::debug::infoObjects(), Foam::nl, Foam::debug::optimisationObjects(), simpleObjectRegistry::setNamedValue(), and validParOptions.
Referenced by argList(), and getList().


|
virtual |
Destructor.
Definition at line 2243 of file argList.C.
References fileOperation::fileHandler(), and Foam::jobInfo.

|
static |
Name of the executable from environment variable.
Returns the contents of the FOAM_EXECUTABLE variable, which has previously been set by argList.
This will normally be identical to the value of executable(), but obtained from the environment.
Definition at line 662 of file argList.C.
References Foam::getEnv().
Referenced by foamReport::setStaticBuiltins().


|
static |
Global case (directory) from environment variable.
Returns the contents of the FOAM_CASE variable, which has previously been set by argList or by Time.
This will normally be identical to the value of globalPath(), but obtained via the environment.
Definition at line 668 of file argList.C.
References Foam::getEnv().
Referenced by pointNoise::calculate(), surfaceNoise::calculate(), envRelativePath(), Time::NewGlobalTime(), and foamReport::setStaticBuiltins().


|
static |
Return the input relative to the globalPath by stripping off a leading value of the envGlobalPath.
| input | the directory or filename to make case-relative |
| caseTag | replace globalPath with <case> for later use with expand(), or prefix <case> if the file name was not an absolute location |
Definition at line 674 of file argList.C.
References envGlobalPath(), fileName::isAbsolute(), and fileName::relative().
Referenced by dictionary::relativeName(), and IOstream::relativeName().


| void parse | ( | bool | checkArgs, |
| bool | checkOpts, | ||
| bool | initialise ) |
Scan for -help, -doc options etc prior to checking the validity of other args/opts and finally initialising.
Definition at line 1241 of file argList.C.
References PstreamBuffers::algorithm, dynamicCode::allowSystemOperations, UPstream::allWorlds(), Foam::foamVersion::api, bannerEnabled(), UPstream::broadcast, Foam::foamVersion::build, Foam::foamVersion::buildArch, fileOperation::cacheLevel(), Foam::check(), fileName::clean(), List< T >::clear(), clock::clockTime(), UPstream::commsTypeNames, UList< T >::contains(), MemoryPool::create(), Foam::cwd(), clock::date(), UPstream::defaultCommsType, fileOperation::defaultFileHandler, DetailInfo, displayDoc(), UList< T >::empty(), Foam::endl(), executable(), Foam::exit(), UPstream::exit(), Foam::FatalError, FatalErrorIn, FatalErrorInFunction, IOobject::fileCheckTypesNames, Foam::fileHandler, fileOperation::fileHandler(), fileOperation::fileHandlerPtr_, IOobject::fileModificationChecking, IOobject::fileModificationSkew, Foam::flatOutput(), UPstream::floatTransfer, forAll, UPstream::gatherList, Foam::getEnv(), dictionary::getOrDefault(), Foam::hostName(), Foam::Info, Foam::debug::infoSwitch(), fileName::isAbsolute(), Foam::isDir(), Foam::jobInfo, libs(), keyType::LITERAL, lookup(), UPstream::master(), UPstream::masterNo(), wordRes::matching(), UPstream::maxCommsSize, IOobject::maxFileModificationPolls, IOobjectOption::MUST_READ, UPstream::myProcNo(), UPstream::myWorld(), Foam::name(), name, fileOperation::New(), Foam::nl, UPstream::nPollProcInterfaces, UPstream::nProcs(), fileOperation::nProcsFilter(), UPstream::nProcsNonblockingExchange, UPstream::nProcsSimpleSum, fileName::null, Foam::debug::optimisationSwitches(), UPstream::parRun(), Foam::foamVersion::patch, Foam::foamVersion::patched(), Foam::pgid(), Foam::pid(), Foam::Pout, Foam::ppid(), Foam::foamVersion::printBuildInfo(), printCompat(), Foam::printHostsSubscription(), printMan(), UPstream::printNodeCommsControl(), printNotes(), Foam::printRootsSubscription(), UPstream::printTopoControl(), printUsage(), List< T >::push_back(), IOobjectOption::READ_IF_PRESENT, dictionary::readEntry(), readIfPresent(), readListIfPresent(), IPBstream::recv(), IPstream::recv(), relativePath(), List< T >::resize(), Foam::returnReduceOr(), UPstream::scheduled, OPBstream::send(), UOPstream::send(), sigFpe::set(), sigInt::set(), sigQuit::set(), sigSegv::set(), size(), UList< T >::size(), string::starts_with(), UPstream::subProcs(), IOobject::timeStamp, IOobject::timeStampMaster, UPstream::tuning_NBX_, Foam::userName(), Foam::foamVersion::version, Foam::Warning, FieldBase::warnLocalBoundaryConsistencyCompat(), UPstream::worldComm, IOobject::writeBanner(), and IOobject::writeDivider().
Referenced by argList().

|
inlinenoexcept |
Name of executable without the path.
Definition at line 44 of file argListI.H.
References Foam::noexcept.
Referenced by parse(), and readCheck().

|
inlinenoexcept |
The command line options and arguments concatenated as a string.
Definition at line 50 of file argListI.H.
References Foam::noexcept.
|
inlinenoexcept |
Return root path.
Definition at line 56 of file argListI.H.
References Foam::noexcept.
Referenced by checkRootCase(), globalPath(), and path().

|
inlinenoexcept |
Return case name (parallel run) or global case (serial run).
Definition at line 62 of file argListI.H.
References Foam::noexcept.
Referenced by path().

|
inlinenoexcept |
Return global case name.
Definition at line 68 of file argListI.H.
References Foam::noexcept.
Referenced by globalPath().

|
inline |
Return the full path to the (processor local) case.
Definition at line 74 of file argListI.H.
References caseName(), and rootPath().

|
inline |
Return the full path to the global case.
Definition at line 80 of file argListI.H.
References globalCaseName(), and rootPath().
Referenced by relativePath().


|
inline |
Return the input relative to the globalPath by stripping off a leading value of the globalPath.
| input | the directory or filename to make case-relative |
| caseTag | replace globalPath with <case> for later use with expand(), or prefix <case> if the file name was not an absolute location |
Definition at line 86 of file argListI.H.
References globalPath(), and fileName::relative().
Referenced by parse().


|
inlinenoexcept |
Return the run control (parallel, dry-run etc).
Definition at line 97 of file argListI.H.
References Foam::noexcept.
|
inlinenoexcept |
Return distributed flag (i.e. are rootPaths different on different machines).
Definition at line 103 of file argListI.H.
References Foam::noexcept.
|
inlinenoexcept |
|
inlinenoexcept |
Modify the dry-run flag.
Definition at line 115 of file argListI.H.
|
inlinenoexcept |
Return the verbose flag.
Definition at line 121 of file argListI.H.
References Foam::noexcept.
Referenced by getList().

|
inlinenoexcept |
Modify the verbose flag.
Definition at line 127 of file argListI.H.
| bool allowFunctionObjects | ( | ) | const |
The controlDict 'functions' entry is allowed to be used.
There must be a command-line option to enable/disable (-withFunctionObjects, -noFunctionObjects) and has not been explicitly disabled
Definition at line 2254 of file argList.C.
References validOptions.
| bool allowLibs | ( | ) | const |
|
inlinenoexcept |
Mutable access to the loaded dynamic libraries.
Definition at line 133 of file argListI.H.
References Foam::noexcept.
Referenced by parse().

|
inlinenoexcept |
The number of arguments.
Definition at line 139 of file argListI.H.
References Foam::noexcept.
Referenced by parse(), printCompat(), and printUsage().

|
inlinenoexcept |
Return arguments.
Definition at line 145 of file argListI.H.
References Foam::noexcept.
Referenced by argList().

|
inlinenoexcept |
Non-const access to the command arguments (non-options).
Definition at line 151 of file argListI.H.
References Foam::noexcept.
|
inlinenoexcept |
Return options.
Definition at line 158 of file argListI.H.
References Foam::noexcept.
Referenced by argList().

|
inlinenoexcept |
Return non-const access to the command options.
Definition at line 165 of file argListI.H.
References Foam::noexcept.
|
inline |
Return true if the named option is found.
Definition at line 171 of file argListI.H.
| Foam::label count | ( | std::initializer_list< word > | optionNames | ) | const |
|
inline |
Return an input stream from the named option.
Definition at line 177 of file argListI.H.
Referenced by optionLookup(), and parse().

Get a value from the argument at index.
Index 1 is the first (non-option) argument. For fileName type, invokes fileName::validate()
Definition at line 271 of file argListI.H.
References Foam::T().
Referenced by Foam::argList::get< Foam::fileName >(), Foam::argList::get< Foam::fileName >(), Foam::argList::get< Foam::string >(), Foam::argList::get< Foam::string >(), Foam::argList::get< Foam::word >(), Foam::argList::get< Foam::word >(), argRead(), get(), getList(), getOrDefault(), opt(), optionRead(), read(), and readIfPresent().


Get a List of values from the argument at index.
Index 1 is the first (non-option) argument.
References get(), getList(), getOrDefault(), and Foam::T().
Referenced by getList(), getList(), and optionReadList().


Get a value from the named option.
The default template parameter is string (ie, no conversion). For fileName type, invokes fileName::validate()
Definition at line 285 of file argListI.H.
References Foam::T().

Get a value from the named option if present, or return default.
Definition at line 299 of file argListI.H.
References get(), and Foam::T().
Referenced by get(), getList(), lookupOrDefault(), opt(), and optionLookupOrDefault().


Get a List of values from the named option, treating a single entry like a list of size 1.
| optName | the option name to read from |
| mandatory | if the option is non-mandatory, the behaviour is similar to readListIfPresent(). |
References addArgument(), addBoolOption(), addDryRunOption(), addNote(), addOption(), addOptionCompat(), addUsage(), addVerboseOption(), argList(), argsMandatory(), bannerEnabled(), check(), checkRootCase(), displayDoc(), FOAM_DEPRECATED_STRICT, getCheck(), getCheckOrDefault(), getList(), ignoreOptionCompat(), noBanner(), noCheckProcessorDirectories(), noFunctionObjects(), noJobInfo(), noLibs(), noMandatoryArgs(), noParallel(), parallelThreads_on(), postProcess(), printCompat(), printMan(), printNotes(), printUsage(), readCheck(), readCheckIfPresent(), readIfPresent(), readListIfPresent(), removeOption(), setAdvanced(), setOption(), Foam::T(), unsetOption(), and verbose().

Read a value from the named option if present.
Definition at line 315 of file argListI.H.
References get(), and Foam::T().
Referenced by getList(), optionReadIfPresent(), optionReadIfPresent(), readCheck(), and readIfPresent().


|
inline |
Read a value from the named option if present.
Definition at line 332 of file argListI.H.
References readIfPresent(), and Foam::T().

If named option is present, get a List of values treating a single entry like a list of size 1.
Definition at line 386 of file argListI.H.
Referenced by getList(), and parse().

|
inline |
Read the named option and check its validity.
FatalError if mandatory and not found, or if the predicate check failed.
| optName | the option name |
| val | the value to read into |
| pred | the value check predicate |
Definition at line 408 of file argListI.H.
References executable(), Foam::exit(), Foam::FatalError, Foam::nl, readIfPresent(), and Foam::T().
Referenced by getCheck(), getCheckOrDefault(), getList(), and readCheckIfPresent().


|
inline |
Read the named option if present and check its validity.
FatalError if found and the predicate check failed.
| optName | the option name |
| val | the value to read into |
| pred | the value check predicate |
Definition at line 437 of file argListI.H.
References readCheck(), and Foam::T().
Referenced by getList().


|
inline |
Get a value from the named option with additional checking.
FatalError if the predicate check failed.
| optName | the option name |
| pred | the value check predicate |
Definition at line 449 of file argListI.H.
References readCheck(), and Foam::T().
Referenced by getList().


|
inline |
Get a value from the named option with additional checking (if present), or return default.
FatalError if the predicate check on the retrieved value failed.
| optName | the option name |
| deflt | the default return value |
| pred | the value check predicate |
Definition at line 462 of file argListI.H.
References readCheck(), and Foam::T().
Referenced by getList().


Add a bool option to validOptions with usage information.
Definition at line 388 of file argList.C.
References addOption().
Referenced by addDryRunOption(), timeSelector::addOptions(), timeSelector::addOptions_singleTime(), addVerboseOption(), getList(), noFunctionObjects(), and noLibs().


|
static |
Add an option to validOptions with usage information.
An option with an empty param is a bool option
Definition at line 399 of file argList.C.
References advancedOptions, optionUsage, and validOptions.
Referenced by addBoolOption(), timeSelector::addOptions(), timeSelector::addOptions_singleTime(), and getList().

|
static |
Set an existing option as being 'advanced' or normal.
Definition at line 419 of file argList.C.
References advancedOptions, and validOptions.
Referenced by getList().

|
static |
Specify an alias for the option name.
| optName | the currently used option name |
| compat | alias name and the last OpenFOAM version (YYMM) when the alias was not needed. Setting a zero or negative version suppresses warnings about the alias. |
Definition at line 432 of file argList.C.
References validOptionsCompat.
Referenced by getList().

|
static |
Specify an option to be ignored.
| compat | optName and the last OpenFOAM version (YYMM) when the option was directly supported. Setting a zero or negative version suppresses warnings about the alias. |
| expectArg | the option is non-bool |
Definition at line 446 of file argList.C.
References ignoreOptionsCompat.
Referenced by getList(), and noFunctionObjects().

Add option usage information to optionUsage.
Definition at line 460 of file argList.C.
References optionUsage.
Referenced by getList().

|
static |
|
static |
Remove option from validOptions and from optionUsage.
Definition at line 486 of file argList.C.
References advancedOptions, optionUsage, and validOptions.
Referenced by getList(), noFunctionObjects(), and noParallel().

|
static |
|
static |
|
static |
Disable emitting the banner information.
Adjusts the Foam::infoDetailLevel flag.
Definition at line 506 of file argList.C.
References Foam::infoDetailLevel.
Referenced by getList().

|
static |
Banner status (enabled/disabled).
Queries the Foam::infoDetailLevel flag.
Definition at line 512 of file argList.C.
References Foam::infoDetailLevel.
Referenced by getList(), and parse().

|
static |
Enable a 'dry-run' bool option, with usage information.
| advanced | usage information (expected) |
Definition at line 518 of file argList.C.
References addBoolOption(), and advancedOptions.
Referenced by getList().


|
static |
Enable a 'verbose' bool option, with usage information.
| advanced | usage information (optional) |
Definition at line 534 of file argList.C.
References addBoolOption(), and advancedOptions.
Referenced by getList().


|
static |
Remove '-noFunctionObjects' option and ignore any occurrences.
Optionally add a '-withFunctionObjects' option instead
Definition at line 562 of file argList.C.
References addBoolOption(), ignoreOptionCompat(), and removeOption().
Referenced by getList().


|
static |
Suppress JobInfo, overriding controlDict setting.
Definition at line 582 of file argList.C.
References JobInfo::disable().
Referenced by getList().


|
static |
Add the '-no-libs' command line option.
Definition at line 588 of file argList.C.
References addBoolOption().
Referenced by getList().


|
static |
Remove the parallel options.
Definition at line 599 of file argList.C.
References removeOption(), and validParOptions.
Referenced by getList().


|
static |
|
static |
Set option directly (use with caution).
An option with an empty param is a bool option. Not all valid options can also be set: eg, -case, -roots, ... Return true if the existing option value needed changing, or if the option did not previously exist.
Definition at line 2308 of file argList.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
Referenced by getList().


| bool unsetOption | ( | const word & | optName | ) |
Unset option directly (use with caution).
Not all valid options can also be unset: eg, -case, -roots ... Return true if the option existed before being unset.
Definition at line 2336 of file argList.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
Referenced by getList().


|
static |
True if the post-processing option is found in the argv list.
Definition at line 625 of file argList.C.
References postProcessOptionName.
Referenced by getList().

|
static |
| void printCompat | ( | ) | const |
Print option compatibility.
Definition at line 533 of file argListHelp.C.
References ignoreOptionsCompat, Foam::Info, k, Foam::nl, Foam::setf(), Foam::setfill(), Foam::setw(), size(), token::SPACE, and validOptionsCompat.
Referenced by getList(), and parse().


| void printNotes | ( | ) | const |
Print notes (if any).
Definition at line 455 of file argListHelp.C.
References Foam::Info, Foam::nl, notes, usageMax, and Foam::stringOps::writeWrapped().
Referenced by getList(), parse(), and printUsage().


| void printUsage | ( | bool | full = true | ) | const |
Print usage.
Definition at line 359 of file argListHelp.C.
References advancedOptions, argUsage, Foam::endl(), ignoreOptionsCompat, Foam::Info, Foam::nl, string::null, Foam::foamVersion::printBuildInfo(), printNotes(), Foam::printOption(), Foam::printOptionUsage(), size(), validArgs, validOptions, and validOptionsCompat.
Referenced by getList(), and parse().


| void printMan | ( | ) | const |
Print usage as nroff-man format (Experimental).
Definition at line 193 of file argListHelp.C.
References advancedOptions, Foam::foamVersion::api, argUsage, token::DQUOTE, ignoreOptionsCompat, Foam::Info, Foam::nl, notes, string::null, Foam::printManFooter(), Foam::printManOption(), token::SPACE, Foam::stringOps::upper(), usageMax, validArgs, validOptions, validOptionsCompat, and Foam::stringOps::writeWrapped().
Referenced by getList(), and parse().


| void displayDoc | ( | bool | source = false | ) | const |
Display documentation in browser.
Optionally display the application source code
Definition at line 2357 of file argList.C.
References Foam::foamVersion::api, string::contains(), Foam::debug::controlDict(), Foam::endl(), Foam::stringOps::expand(), dictionary::get(), Foam::getEnv(), Foam::Info, Foam::isFile(), Foam::nl, dictionary::readEntry(), string::replace(), Foam::stringOps::splitSpace(), string::starts_with(), dictionary::subDict(), and Foam::system().
Referenced by getList(), and parse().


| bool check | ( | bool | checkArgs = argList::argsMandatory(), |
| bool | checkOpts = true ) const |
Check the parsed command-line for mandatory arguments and that all the options are correct.
By default, the argument check respects the value of argsMandatory() to decide if the arguments should be checked (when they are mandatory) or not (when they are optional)
Definition at line 2431 of file argList.C.
References Foam::endl(), Foam::FatalError, forAllConstIters, UPstream::master(), Foam::nl, validArgs, validOptions, and validParOptions.
Referenced by getList().


| bool checkRootCase | ( | ) | const |
Check root path and case path.
Definition at line 2479 of file argList.C.
References Foam::endl(), Foam::FatalError, Foam::fileHandler, Foam::isDir(), UPstream::master(), path(), and rootPath().
Referenced by getList().


|
inline |
The string corresponding to the argument index.
Index 0 is the executable. Index 1 is the first (non-option) argument.
Definition at line 483 of file argListI.H.
|
inline |
The string associated with the named option.
Definition at line 489 of file argListI.H.
Deprecated(2020-05) identical to getOrDefault(...).
Definition at line 997 of file argList.H.
References getOrDefault(), opt(), and Foam::T().

Deprecated(2020-05) identical to getOrDefault(...).
Definition at line 1009 of file argList.H.
References get(), getOrDefault(), and Foam::T().

Deprecated(2020-05) identical to getOrDefault(...).
Definition at line 1021 of file argList.H.
References getOrDefault(), lookupOrDefault(), and Foam::T().
Referenced by lookupOrDefault().


|
inline |
Same as runControl() - v2106 and earlier.
Deprecated(2018-08) read a value from the argument at index.
Index 1 is the first (non-option) argument.
Definition at line 1044 of file argList.H.
References get(), read(), and Foam::T().
Referenced by read().


Deprecated(2018-01) read a value from the argument at index.
Index 1 is the first (non-option) argument.
Definition at line 1057 of file argList.H.
References argRead(), get(), and Foam::T().
Referenced by argRead().


|
inline |
Deprecated(2018-01) return true if the named option is found.
Definition at line 1068 of file argList.H.
References found, and optionFound().
Referenced by optionFound().


Deprecated(2018-01) return an input stream from the named option.
Definition at line 1079 of file argList.H.
References lookup(), and optionLookup().
Referenced by optionLookup().


Deprecated(2018-01) read a value from the named option.
Definition at line 1091 of file argList.H.
References get(), optionRead(), and Foam::T().
Referenced by optionRead().


Deprecated(2018-01) read a value from the named option if present.
Return true if the named option was found.
Definition at line 1104 of file argList.H.
References optionReadIfPresent(), readIfPresent(), and Foam::T().
Referenced by optionReadIfPresent(), and optionReadIfPresent().


|
inline |
Deprecated(2018-01) read a value from the named option if present.
Return true if the named option was found, otherwise use the supplied default and return false.
Definition at line 1122 of file argList.H.
References optionReadIfPresent(), readIfPresent(), and Foam::T().

Deprecated(2018-01) read a value from the named option if present.
Return supplied default otherwise.
Definition at line 1140 of file argList.H.
References getOrDefault(), optionLookupOrDefault(), and Foam::T().
Referenced by optionLookupOrDefault().


Deprecated(2018-01) read a List of values from the named option.
Definition at line 1156 of file argList.H.
References getList(), optionReadList(), and Foam::T().
Referenced by optionReadList().


|
inline |
Definition at line 187 of file argListI.H.
References Foam::readInt32().

|
inline |
Definition at line 192 of file argListI.H.
References Foam::readInt64().

|
inline |
Definition at line 197 of file argListI.H.
|
inline |
Definition at line 202 of file argListI.H.
|
inline |
Definition at line 208 of file argListI.H.
References Foam::readInt32().

|
inline |
Definition at line 213 of file argListI.H.
References Foam::readInt64().

|
inline |
Definition at line 218 of file argListI.H.
|
inline |
Definition at line 223 of file argListI.H.
|
inline |
Definition at line 350 of file argListI.H.
|
inline |
Definition at line 364 of file argListI.H.
|
static |
A list of valid (mandatory) arguments.
Definition at line 245 of file argList.H.
Referenced by addArgument(), check(), printMan(), and printUsage().
|
static |
The "advanced" options are shown with -help-full (not with –help).
Definition at line 250 of file argList.H.
Referenced by addDryRunOption(), addOption(), addVerboseOption(), printMan(), printUsage(), removeOption(), and setAdvanced().
|
static |
A list of valid options.
Definition at line 255 of file argList.H.
Referenced by addOption(), allowFunctionObjects(), check(), printMan(), Foam::printManOption(), Foam::printOption(), printUsage(), removeOption(), timeSelector::select(), setAdvanced(), and timeSelector::setTimeIfPresent().
|
static |
A list of valid parallel options.
Definition at line 260 of file argList.H.
Referenced by argList(), check(), noParallel(), and Foam::printManOption().
|
static |
A list of aliases for options.
Stored as (alias = canonical, version)
Definition at line 267 of file argList.H.
Referenced by addOptionCompat(), printCompat(), printMan(), and printUsage().
|
static |
A list of options to ignore.
Stored as (option = bool, version)
Definition at line 274 of file argList.H.
Referenced by ignoreOptionCompat(), printCompat(), printMan(), and printUsage().
|
static |
Short description for program arguments.
Definition at line 279 of file argList.H.
Referenced by addArgument(), printMan(), and printUsage().
|
static |
Short description for validOptions.
Definition at line 284 of file argList.H.
Referenced by addOption(), addUsage(), Foam::printManOption(), Foam::printOption(), and removeOption().
|
static |
General usage notes.
Definition at line 289 of file argList.H.
Referenced by addNote(), printMan(), and printNotes().
|
static |
Min indentation when displaying usage (default: 20).
Definition at line 294 of file argList.H.
Referenced by Foam::printOptionUsage().
|
static |
Max screen width when displaying usage (default: 80).
Definition at line 299 of file argList.H.
Referenced by printMan(), Foam::printManOption(), printNotes(), and Foam::printOptionUsage().
|
static |
Standard name for the post-processing option.
Definition at line 304 of file argList.H.
Referenced by postProcess().