Extract command arguments and options from the supplied argc and argv parameters. More...
Public Member Functions | |
argList (int &argc, char **&argv, bool checkArgs=argList::argsMandatory(), bool checkOpts=true, bool initialise=true) | |
argList (const argList &args, const HashTable< string > &options, bool checkArgs=true, bool checkOpts=true, bool initialise=true) | |
Construct copy with new options. More... | |
virtual | ~argList () |
Destructor. More... | |
void | parse (bool checkArgs, bool checkOpts, bool initialise) |
const word & | executable () const noexcept |
Name of executable without the path. More... | |
const string & | commandLine () const noexcept |
The command line options and arguments concatenated as a string. More... | |
const fileName & | rootPath () const noexcept |
Return root path. More... | |
const fileName & | caseName () const noexcept |
Return case name (parallel run) or global case (serial run) More... | |
const fileName & | globalCaseName () const noexcept |
Return global case name. More... | |
fileName | path () const |
Return the full path to the (processor local) case. More... | |
fileName | globalPath () const |
Return the full path to the global case. More... | |
fileName | relativePath (const fileName &input, const bool caseTag=false) const |
const ParRunControl & | runControl () const noexcept |
Return the run control (parallel, dry-run etc) More... | |
bool | distributed () const noexcept |
int | dryRun () const noexcept |
Return the dry-run flag. More... | |
int | dryRun (const int level) noexcept |
Modify the dry-run flag. More... | |
int | verbose () const noexcept |
Return the verbose flag. More... | |
int | verbose (const int level) noexcept |
Modify the verbose flag. More... | |
dlLibraryTable & | libs () const noexcept |
Mutable access to the loaded dynamic libraries. More... | |
label | size () const noexcept |
The number of arguments. More... | |
const stringList & | args () const noexcept |
Return arguments. More... | |
stringList & | args () noexcept |
Non-const access to the command arguments (non-options) More... | |
const HashTable< string > & | options () const noexcept |
Return options. More... | |
HashTable< string > & | options () noexcept |
Return non-const access to the command options. More... | |
bool | found (const word &optName) const |
Return true if the named option is found. More... | |
label | count (const UList< word > &optionNames) const |
Return how many of the specified options were used. More... | |
label | count (std::initializer_list< word > optionNames) const |
Return how many of the specified options were used. More... | |
ITstream | lookup (const word &optName) const |
Return an input stream from the named option. More... | |
template<class T > | |
T | get (const label index) const |
Get a value from the argument at index. More... | |
template<class T > | |
List< T > | getList (const label index) const |
Get a List of values from the argument at index. More... | |
template<class T = string> | |
T | get (const word &optName) const |
Get a value from the named option. More... | |
template<class T > | |
T | getOrDefault (const word &optName, const T &deflt) const |
Get a value from the named option if present, or return default. More... | |
template<class T > | |
List< T > | getList (const word &optName, bool mandatory=true) const |
template<class T > | |
bool | readIfPresent (const word &optName, T &val) const |
Read a value from the named option if present. More... | |
template<class T > | |
bool | readIfPresent (const word &optName, T &val, const T &deflt) const |
Read a value from the named option if present. More... | |
template<class T > | |
bool | readListIfPresent (const word &optName, List< T > &list) const |
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. More... | |
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. More... | |
template<class T , class Predicate > | |
T | getCheck (const word &optName, const Predicate &pred) const |
Get a value from the named option with additional checking. More... | |
template<class T , class Predicate > | |
T | getCheckOrDefault (const word &optName, const T &deflt, const Predicate &pred) const |
bool | setOption (const word &optName, const string ¶m="") |
Set option directly (use with caution) More... | |
bool | unsetOption (const word &optName) |
Unset option directly (use with caution) More... | |
void | printCompat () const |
Print option compatibility. More... | |
void | printNotes () const |
Print notes (if any) More... | |
void | printUsage (bool full=true) const |
Print usage. More... | |
void | printMan () const |
Print usage as nroff-man format (Experimental) More... | |
void | displayDoc (bool source=false) const |
Display documentation in browser. More... | |
bool | check (bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const |
bool | checkRootCase () const |
Check root path and case path. More... | |
const string & | operator[] (const label index) const |
The string corresponding to the argument index. More... | |
const string & | operator[] (const word &optName) const |
The string associated with the named option. More... | |
template<class T = string> | |
T | opt (const word &optName) const |
Deprecated(2020-05) identical to get(const word& optName) More... | |
template<class T > | |
T | opt (const word &optName, const T &deflt) const |
Deprecated(2020-05) identical to getOrDefault(...) More... | |
template<class T > | |
T | get (const word &optName, const T &deflt) const |
Deprecated(2020-05) identical to getOrDefault(...) More... | |
template<class T > | |
T | lookupOrDefault (const word &optName, const T &deflt) const |
Deprecated(2020-05) identical to getOrDefault(...) More... | |
const ParRunControl & | parRunControl () const |
Same as runControl() - v2106 and earlier. More... | |
template<class T > | |
T | read (const label index) const |
Deprecated(2018-08) read a value from the argument at index. More... | |
template<class T > | |
T | argRead (const label index) const |
Deprecated(2018-01) read a value from the argument at index. More... | |
bool | optionFound (const word &optName) const |
Deprecated(2018-01) return true if the named option is found. More... | |
ITstream | optionLookup (const word &optName) const |
Deprecated(2018-01) return an input stream from the named option. More... | |
template<class T > | |
T | optionRead (const word &optName) const |
Deprecated(2018-01) read a value from the named option. More... | |
template<class T > | |
bool | optionReadIfPresent (const word &optName, T &val) const |
Deprecated(2018-01) read a value from the named option if present. More... | |
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. More... | |
template<class T > | |
T | optionLookupOrDefault (const word &optName, const T &deflt) const |
Deprecated(2018-01) read a value from the named option if present. More... | |
template<class T > | |
List< T > | optionReadList (const word &optName) const |
Deprecated(2018-01) read a List of values from the named option. More... | |
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. More... | |
static fileName | envGlobalPath () |
Global case (directory) from environment variable. More... | |
static fileName | envRelativePath (const fileName &input, const bool caseTag=false) |
static void | addArgument (const string &argName, const string &usage="") |
Append a (mandatory) argument to validArgs. More... | |
static void | addBoolOption (const word &optName, const string &usage="", bool advanced=false) |
Add a bool option to validOptions with usage information. More... | |
static void | addOption (const word &optName, const string ¶m="", const string &usage="", bool advanced=false) |
Add an option to validOptions with usage information. More... | |
static void | setAdvanced (const word &optName, bool advanced=true) |
Set an existing option as being 'advanced' or normal. More... | |
static void | addOptionCompat (const word &optName, std::pair< const char *, int > compat) |
Specify an alias for the option name. More... | |
static void | ignoreOptionCompat (std::pair< const char *, int > compat, bool expectArg) |
Specify an option to be ignored. More... | |
static void | addUsage (const word &optName, const string &usage) |
Add option usage information to optionUsage. More... | |
static void | addNote (const string ¬e) |
Add extra notes for the usage information. More... | |
static void | removeOption (const word &optName) |
Remove option from validOptions and from optionUsage. More... | |
static void | noMandatoryArgs () |
Flag command arguments as being optional (non-mandatory) More... | |
static bool | argsMandatory () |
Command arguments type (optional/mandatory). More... | |
static void | noBanner () |
Disable emitting the banner information. More... | |
static bool | bannerEnabled () |
Banner status (enabled/disabled). More... | |
static void | addDryRunOption (const string &usage, bool advanced=false) |
Enable a 'dry-run' bool option, with usage information. More... | |
static void | addVerboseOption (const string &usage, bool advanced=false) |
Enable a 'verbose' bool option, with usage information. More... | |
static void | noFunctionObjects (bool addWithOption=false) |
Remove '-noFunctionObjects' option and ignore any occurrences. More... | |
static void | noJobInfo () |
Suppress JobInfo, overriding controlDict setting. More... | |
static void | noLibs () |
Add the '-no-libs' command line option. More... | |
static void | noParallel () |
Remove the parallel options. More... | |
static void | noCheckProcessorDirectories () |
Remove checking of processor directories. More... | |
static bool | postProcess (int argc, char *argv[]) |
Return true if the post-processing option is specified. More... | |
Static Public Attributes | |
static SLList< string > | validArgs |
A list of valid (mandatory) arguments. More... | |
static HashSet< string > | advancedOptions |
The "advanced" options are shown with -help-full (not with –help) More... | |
static HashTable< string > | validOptions |
A list of valid options. More... | |
static HashTable< string > | validParOptions |
A list of valid parallel options. More... | |
static HashTable< std::pair< word, int > > | validOptionsCompat |
A list of aliases for options. More... | |
static HashTable< std::pair< bool, int > > | ignoreOptionsCompat |
A list of options to ignore. More... | |
static HashTable< string, label, Hash< label > > | argUsage |
Short description for program arguments. More... | |
static HashTable< string > | optionUsage |
Short description for validOptions. More... | |
static SLList< string > | notes |
General usage notes. More... | |
static std::string::size_type | usageMin = 20 |
Min indentation when displaying usage (default: 20) More... | |
static std::string::size_type | usageMax = 80 |
Max screen width when displaying usage (default: 80) More... | |
static word | postProcessOptionName |
Standard name for the post-processing option. More... | |
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.Documentation/docBrowser
entry in the <etc>/controlDict
file. The %f token is used as a placeholder for the file name.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 787 of file argList.C.
References dlLibraryTable::append(), Foam::debug::debugObjects(), fileOperation::defaultFileHandler, DetailInfo, ParRunControl::dryRun(), Foam::endl(), JobInfo::exit(), Foam::getEnv(), Switch::good(), Foam::Info, Foam::debug::infoObjects(), Switch::INVALID, argList::libs(), fileName::name(), Time::New(), Foam::nl, Foam::debug::optimisationObjects(), argList::parse(), Foam::foamVersion::printBuildInfo(), ParRunControl::runPar(), simpleObjectRegistry::setNamedValue(), messageStream::stdStream(), argList::validOptions, argList::validParOptions, ParRunControl::verbose(), and Foam::Warning.
argList | ( | const argList & | args, |
const HashTable< string > & | options, | ||
bool | checkArgs = true , |
||
bool | checkOpts = true , |
||
bool | initialise = true |
||
) |
Construct copy with new options.
Definition at line 999 of file argList.C.
References argList::parse().
|
virtual |
Destructor.
Definition at line 1749 of file argList.C.
References Foam::fileHandler(), Foam::jobInfo, and JobInfo::stop().
|
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 543 of file argList.C.
References Foam::getEnv().
|
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 549 of file argList.C.
References Foam::getEnv().
Referenced by noiseModel::baseFileDir(), pointNoise::calculate(), surfaceNoise::calculate(), boundaryDataWriter::write(), and boundaryDataWriter::writeTemplate().
|
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 555 of file argList.C.
References Foam::input().
Referenced by IOstream::relativeName(), and dictionary::relativeName().
Scan for -help, -doc options etc prior to checking the validity of other args/opts and finally initialising.
Definition at line 1022 of file argList.C.
References dictionary::add(), dynamicCode::allowSystemOperations, UPstream::allWorlds(), Foam::foamVersion::api, Foam::foamVersion::build, Foam::foamVersion::buildArch, Foam::check(), fileName::clean(), List< T >::clear(), clock::clockTime(), UPstream::commsTypeNames, Foam::cwd(), clock::date(), UPstream::defaultCommsType, fileOperation::defaultFileHandler, DetailInfo, UList< T >::empty(), Foam::endl(), JobInfo::exit(), Foam::exit(), Foam::FatalError, FatalErrorIn, FatalErrorInFunction, IOobject::fileCheckTypesNames, Foam::fileHandler(), fileOperation::fileHandlerPtr_, IOobject::fileModificationChecking, IOobject::fileModificationSkew, Foam::findMatchingStrings(), Foam::flatOutput(), UPstream::floatTransfer, forAll, Foam::getEnv(), dictionary::getOrDefault(), autoPtr< T >::good(), Foam::hostName(), Foam::Info, Foam::debug::infoSwitch(), fileName::isAbsolute(), Foam::isDir(), Foam::jobInfo, keyType::LITERAL, splitCell::master(), UPstream::masterNo(), IOobject::maxFileModificationPolls, processorFaPatch::myProcNo(), UPstream::myWorld(), Foam::name(), Time::New(), Foam::nl, UPstream::nPollProcInterfaces, PstreamBuffers::nProcs(), UPstream::nProcsSimpleSum, UPstream::parRun(), argList::parse(), Foam::foamVersion::patch, Foam::foamVersion::patched(), Foam::pgid(), Foam::pid(), Foam::ppid(), Foam::foamVersion::printBuildInfo(), Foam::printHostsSubscription(), dictionary::readEntry(), readIfPresent(), List< T >::resize(), UPstream::scheduled, triad::set(), UList< T >::size(), string::starts_with(), messageStream::stdStream(), PstreamBuffers::subProcs(), IOobject::timeStamp, IOobject::timeStampMaster, Foam::userName(), Foam::foamVersion::version, Foam::Warning, JobInfo::write(), error::write(), IOobject::writeBanner(), and IOobject::writeDivider().
Referenced by argList::argList(), and argList::parse().
|
inlinenoexcept |
Name of executable without the path.
Definition at line 51 of file argListI.H.
Referenced by if().
|
inlinenoexcept |
The command line options and arguments concatenated as a string.
Definition at line 57 of file argListI.H.
|
inlinenoexcept |
Return root path.
Definition at line 63 of file argListI.H.
|
inlinenoexcept |
Return case name (parallel run) or global case (serial run)
Definition at line 69 of file argListI.H.
|
inlinenoexcept |
Return global case name.
Definition at line 75 of file argListI.H.
|
inline |
Return the full path to the (processor local) case.
Definition at line 81 of file argListI.H.
|
inline |
Return the full path to the global case.
Definition at line 87 of file argListI.H.
|
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 93 of file argListI.H.
References Foam::input().
Referenced by if().
|
inlinenoexcept |
Return the run control (parallel, dry-run etc)
Definition at line 104 of file argListI.H.
|
inlinenoexcept |
Return distributed flag (i.e. are rootPaths different on different machines)
Definition at line 110 of file argListI.H.
|
inlinenoexcept |
Return the dry-run flag.
Definition at line 116 of file argListI.H.
Referenced by forAll(), and dynamicFvMesh::New().
|
inlinenoexcept |
Modify the dry-run flag.
Definition at line 122 of file argListI.H.
|
inlinenoexcept |
Return the verbose flag.
Definition at line 128 of file argListI.H.
|
inlinenoexcept |
Modify the verbose flag.
Definition at line 134 of file argListI.H.
|
inlinenoexcept |
Mutable access to the loaded dynamic libraries.
Definition at line 140 of file argListI.H.
Referenced by argList::argList().
|
inlinenoexcept |
The number of arguments.
Definition at line 146 of file argListI.H.
Referenced by functionObjectList::readFunctionObject(), zoltanRenumber::renumber(), and Foam::stringOps::splitFunctionArgs().
|
inlinenoexcept |
Return arguments.
Definition at line 152 of file argListI.H.
|
inlinenoexcept |
Non-const access to the command arguments (non-options)
Definition at line 158 of file argListI.H.
|
inlinenoexcept |
Return options.
Definition at line 165 of file argListI.H.
|
inlinenoexcept |
Return non-const access to the command options.
Definition at line 172 of file argListI.H.
Return true if the named option is found.
Definition at line 178 of file argListI.H.
Referenced by forAll(), if(), dynamicFvMesh::New(), functionObjectList::New(), timeSelector::select(), timeSelector::selectIfPresent(), and Time::Time().
Foam::label count | ( | std::initializer_list< word > | optionNames | ) | const |
|
inline |
Return an input stream from the named option.
Definition at line 184 of file argListI.H.
|
inline |
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 278 of file argListI.H.
References T.
Referenced by if().
Get a List of values from the argument at index.
Index 1 is the first (non-option) argument.
Referenced by functionObjectList::New().
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 292 of file argListI.H.
References T.
Get a value from the named option if present, or return default.
Definition at line 306 of file argListI.H.
References found.
Referenced by functionObjectList::New().
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(). |
Read a value from the named option if present.
Definition at line 322 of file argListI.H.
References found, and argList::readIfPresent().
Referenced by if(), and argList::readIfPresent().
Read a value from the named option if present.
Definition at line 339 of file argListI.H.
References argList::readIfPresent().
If named option is present, get a List of values treating a single entry like a list of size 1.
Definition at line 393 of file argListI.H.
References found.
|
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 415 of file argListI.H.
References Foam::exit(), Foam::FatalError, and Foam::nl.
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 444 of file argListI.H.
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 456 of file argListI.H.
References T.
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 469 of file argListI.H.
References T.
Add a bool option to validOptions with usage information.
Definition at line 323 of file argList.C.
References argList::addOption().
Referenced by argList::addDryRunOption(), timeSelector::addOptions(), argList::addVerboseOption(), argList::noFunctionObjects(), and argList::noLibs().
|
static |
Add an option to validOptions with usage information.
An option with an empty param is a bool option
Definition at line 334 of file argList.C.
Referenced by argList::addBoolOption(), and timeSelector::addOptions().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Disable emitting the banner information.
Adjusts the Foam::infoDetailLevel flag.
Definition at line 441 of file argList.C.
References Foam::infoDetailLevel.
|
static |
Banner status (enabled/disabled).
Queries the Foam::infoDetailLevel flag.
Definition at line 447 of file argList.C.
References Foam::infoDetailLevel.
Enable a 'dry-run' bool option, with usage information.
advanced | usage information (expected) |
Definition at line 453 of file argList.C.
References argList::addBoolOption().
Enable a 'verbose' bool option, with usage information.
advanced | usage information (expected) |
Definition at line 463 of file argList.C.
References argList::addBoolOption().
|
static |
Remove '-noFunctionObjects' option and ignore any occurrences.
Optionally add a '-withFunctionObjects' option instead
Definition at line 473 of file argList.C.
References argList::addBoolOption().
|
static |
Suppress JobInfo, overriding controlDict setting.
Definition at line 493 of file argList.C.
References JobInfo::disable().
|
static |
Add the '-no-libs' command line option.
Definition at line 499 of file argList.C.
References argList::addBoolOption().
|
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 1791 of file argList.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
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 1817 of file argList.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
void printCompat | ( | ) | const |
Print option compatibility.
Definition at line 540 of file argListHelp.C.
References HashTable< T, Key, Hash >::cfind(), argList::ignoreOptionsCompat, Foam::Info, k, Foam::nl, Foam::setf(), Foam::setfill(), Foam::setw(), token::SPACE, and argList::validOptionsCompat.
void printNotes | ( | ) | const |
Print notes (if any)
Definition at line 462 of file argListHelp.C.
References Foam::Info, Foam::nl, and Foam::stringOps::writeWrapped().
void printUsage | ( | bool | full = true | ) | const |
Print usage.
Definition at line 366 of file argListHelp.C.
References argList::argUsage, Foam::endl(), argList::ignoreOptionsCompat, Foam::Info, Foam::nl, Foam::foamVersion::printBuildInfo(), Foam::printOption(), Foam::printOptionUsage(), messageStream::stdStream(), and argList::validOptionsCompat.
void printMan | ( | ) | const |
Print usage as nroff-man format (Experimental)
Definition at line 200 of file argListHelp.C.
References argList::advancedOptions, Foam::foamVersion::api, argList::argUsage, token::DQUOTE, HashTable< T, Key, Hash >::empty(), argList::ignoreOptionsCompat, Foam::Info, Foam::nl, argList::notes, Foam::printManFooter(), Foam::printManOption(), token::SPACE, Foam::stringOps::upper(), argList::usageMax, argList::validArgs, argList::validOptions, argList::validOptionsCompat, and Foam::stringOps::writeWrapped().
void displayDoc | ( | bool | source = false | ) | const |
Display documentation in browser.
Optionally display the application source code
Definition at line 1839 of file argList.C.
References Foam::foamVersion::api, 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().
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 1913 of file argList.C.
References argList::check(), Foam::endl(), Foam::FatalError, forAllConstIters, splitCell::master(), and Foam::nl.
Referenced by argList::check().
bool checkRootCase | ( | ) | const |
Check root path and case path.
Definition at line 1959 of file argList.C.
References Foam::endl(), Foam::FatalError, Foam::fileHandler(), Foam::isDir(), splitCell::master(), and path().
|
inline |
The string corresponding to the argument index.
Index 0 is the executable. Index 1 is the first (non-option) argument.
Definition at line 490 of file argListI.H.
|
inline |
The string associated with the named option.
Definition at line 496 of file argListI.H.
Deprecated(2020-05) identical to get(const word& optName)
Deprecated(2020-05) identical to getOrDefault(...)
Deprecated(2020-05) identical to getOrDefault(...)
Deprecated(2020-05) identical to getOrDefault(...)
|
inline |
Same as runControl() - v2106 and earlier.
|
inline |
Deprecated(2018-08) read a value from the argument at index.
Index 1 is the first (non-option) argument.
|
inline |
Deprecated(2018-01) read a value from the argument at index.
Index 1 is the first (non-option) argument.
Deprecated(2018-01) return true if the named option is found.
Definition at line 771 of file argList.H.
References found.
Deprecated(2018-01) return an input stream from the named option.
Deprecated(2018-01) read a value from the named option.
Deprecated(2018-01) read a value from the named option if present.
Return true if the named option was found.
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.
Deprecated(2018-01) read a value from the named option if present.
Return supplied default otherwise.
Deprecated(2018-01) read a List of values from the named option.
|
inline |
Definition at line 194 of file argListI.H.
References Foam::readInt32().
|
inline |
Definition at line 199 of file argListI.H.
References Foam::readInt64().
|
inline |
Definition at line 204 of file argListI.H.
|
inline |
Definition at line 209 of file argListI.H.
|
inline |
Definition at line 215 of file argListI.H.
References Foam::readInt32().
|
inline |
Definition at line 220 of file argListI.H.
References Foam::readInt64().
|
inline |
Definition at line 225 of file argListI.H.
|
inline |
Definition at line 230 of file argListI.H.
|
inline |
Definition at line 357 of file argListI.H.
|
inline |
Definition at line 371 of file argListI.H.
References found.
|
static |
A list of valid (mandatory) arguments.
Definition at line 206 of file argList.H.
Referenced by argList::printMan().
|
static |
The "advanced" options are shown with -help-full (not with –help)
Definition at line 209 of file argList.H.
Referenced by argList::printMan().
|
static |
A list of valid options.
Definition at line 212 of file argList.H.
Referenced by argList::argList(), argList::printMan(), Foam::printManOption(), Foam::printOption(), timeSelector::select(), and Time::Time().
|
static |
A list of valid parallel options.
Definition at line 215 of file argList.H.
Referenced by argList::argList(), and Foam::printManOption().
|
static |
A list of aliases for options.
Stored as (alias = canonical, version)
Definition at line 219 of file argList.H.
Referenced by argList::printCompat(), argList::printMan(), and argList::printUsage().
|
static |
A list of options to ignore.
Stored as (option = bool, version)
Definition at line 223 of file argList.H.
Referenced by argList::printCompat(), argList::printMan(), and argList::printUsage().
|
static |
Short description for program arguments.
Definition at line 226 of file argList.H.
Referenced by argList::printMan(), and argList::printUsage().
|
static |
Short description for validOptions.
Definition at line 229 of file argList.H.
Referenced by Foam::printManOption(), and Foam::printOption().
|
static |
|
static |
Min indentation when displaying usage (default: 20)
Definition at line 235 of file argList.H.
Referenced by Foam::printOptionUsage().
|
static |
Max screen width when displaying usage (default: 80)
Definition at line 238 of file argList.H.
Referenced by argList::printMan(), Foam::printManOption(), and Foam::printOptionUsage().
|
static |