Go to the documentation of this file.
55 bool Foam::argList::argsMandatory_ =
true;
56 bool Foam::argList::checkProcessorDirectories_ =
true;
73 Foam::argList::initValidTables::initValidTables()
79 "Specify case directory to use (instead of the cwd)"
85 "Additional library or library list to load"
86 " (can be used multiple times)",
94 "Specify the value of a registered debug switch."
95 " Default is 1 if the value is omitted."
96 " (Can be used multiple times)",
104 "Specify the value of a registered info switch."
105 " Default is 1 if the value is omitted."
106 " (Can be used multiple times)",
114 "Specify the value of a registered optimisation switch (int/bool)."
115 " Default is 1 if the value is omitted."
116 " (Can be used multiple times)",
120 argList::addBoolOption(
"parallel",
"Run in parallel");
121 validParOptions.set(
"parallel",
"");
126 "Slave root directories for distributed running",
139 "Use specified file for decomposePar dictionary"
144 "((host1 dir1) .. (hostN dirN))",
145 "Per-host slave root directories for distributed running."
146 " The host specification can be a regex.",
152 "((host1 dir1) .. (hostN dirN))"
155 argList::addBoolOption
158 "Do not execute function objects",
166 "Override the file handler type",
176 Pstream::addValidParOptions(validParOptions);
191 static inline constexpr
bool shouldWarnVersion(
const int version)
210 Info<<
"Hosts :" <<
nl <<
"(" <<
nl;
215 for (
const auto& str : slaveProcs)
217 std::string curr(str.substr(0, str.rfind(
'.')));
224 Info<<
" (" << prev.c_str() <<
" " <<
count <<
")" <<
nl;
228 prev = std::move(curr);
236 Info<<
" (" << prev.c_str() <<
" " <<
count <<
")" <<
nl;
247 void Foam::argList::checkITstream(
const ITstream& is,
const label index)
249 const label remaining = is.nRemainingTokens();
255 <<
"--> FOAM WARNING:" <<
nl
256 <<
"Argument " << index <<
" has "
257 << remaining <<
" excess tokens" <<
nl <<
nl;
263 <<
"--> FOAM WARNING:" <<
nl
264 <<
"Argument " << index <<
" had no tokens" <<
nl <<
nl;
269 void Foam::argList::checkITstream(
const ITstream& is,
const word& optName)
271 const label remaining = is.nRemainingTokens();
277 <<
"--> FOAM WARNING:" <<
nl
278 <<
"Option -" << optName <<
" has "
279 << remaining <<
" excess tokens" <<
nl <<
nl;
285 <<
"--> FOAM WARNING:" <<
nl
286 <<
"Option -" << optName <<
" had no tokens" <<
nl <<
nl;
291 void Foam::argList::raiseBadInput(
const word& optName)
const
296 <<
"Option -" << optName <<
" with invalid input" <<
nl
303 const string& argName,
307 validArgs.append(argName);
311 const label index = validArgs.size();
315 argUsage.erase(index);
319 argUsage.set(index, usage);
331 addOption(optName,
"", usage, advanced);
343 validOptions.set(optName, param);
346 optionUsage.set(optName, usage);
350 advancedOptions.set(optName);
357 if (advanced && validOptions.found(optName))
359 advancedOptions.set(optName);
363 advancedOptions.erase(optName);
371 std::pair<const char*,int> compat
374 validOptionsCompat.insert
377 std::pair<word,int>(optName, compat.second)
384 std::pair<const char*,int> compat,
388 ignoreOptionsCompat.insert
391 std::pair<bool,int>(expectArg, compat.second)
404 optionUsage.erase(optName);
408 optionUsage.set(optName, usage);
424 validOptions.erase(optName);
425 optionUsage.erase(optName);
426 advancedOptions.erase(optName);
432 argsMandatory_ =
false;
438 return argsMandatory_;
456 removeOption(
"noFunctionObjects");
460 ignoreOptionCompat({
"noFunctionObjects", 0},
false);
466 "withFunctionObjects",
467 "Execute functionObjects",
485 "Disable use of the controlDict libs entry",
493 removeOption(
"parallel");
494 removeOption(
"roots");
495 removeOption(
"decomposeParDict");
496 removeOption(
"hostRoots");
497 validParOptions.clear();
503 checkProcessorDirectories_ =
false;
509 for (
int i=1; i<argc; ++i)
511 if (argv[i] ==
'-' + postProcessOptionName)
536 if (!validOptionsCompat.empty())
538 const auto fnd = validOptionsCompat.cfind(optName.substr(1));
542 const auto& iter = *fnd;
544 if (shouldWarnVersion(iter.second))
547 <<
"--> FOAM IOWarning :" <<
nl
548 <<
" Found [v" << iter.second <<
"] '"
549 << optName <<
"' instead of '-"
550 << iter.first <<
"' option"
557 return "-" + iter.first;
566 int Foam::argList::optionIgnore(
const word& optName)
570 if (!ignoreOptionsCompat.empty())
572 const auto fnd = ignoreOptionsCompat.cfind(optName);
576 const auto& iter = *fnd;
580 const int nskip = (iter.first ? 2 : 1);
582 if (shouldWarnVersion(iter.second))
585 <<
"--> FOAM IOWarning :" <<
nl
586 <<
" Ignoring [v" << iter.second <<
"] '-"
587 << optName << (nskip > 1 ?
" ARG" :
"")
603 bool Foam::argList::regroupArgv(
int& argc,
char**& argv)
613 args_[0] = fileName(argv[0]);
614 for (
int argi = 1; argi < argc; ++argi)
616 if (strcmp(argv[argi],
"(") == 0)
621 else if (strcmp(argv[argi],
")") == 0)
629 args_[nArgs++] =
group;
635 args_[nArgs++] = argv[argi];
645 else if (argv[argi][0] ==
'-')
648 const char *optName = &argv[argi][1];
650 if (validOptions.found(optName))
653 args_[nArgs++] = argv[argi];
655 else if ((ignore = optionIgnore(optName)) > 0)
666 args_[nArgs++] = optionCompat(argv[argi]);
671 args_[nArgs++] = argv[argi];
678 args_[nArgs++] =
group;
684 for (
const auto&
s : args_)
690 commandLine_.reserve(len);
696 void Foam::argList::setCasePaths()
700 const auto optIter = options_.cfind(
"case");
707 if (caseDir.empty() || caseDir ==
".")
711 options_.erase(
"case");
715 caseDir.toAbsolute();
726 rootPath_ = caseDir.path();
727 globalCase_ = caseDir.name();
734 setEnv(
"FOAM_CASE", caseDir,
true);
735 setEnv(
"FOAM_CASENAME", globalCase_,
true);
738 setEnv(
"FOAM_EXECUTABLE", executable_,
false);
759 for (
int argi = argc-2; argi > 0; --argi)
761 if (argv[argi][0] ==
'-')
763 const char *optName = &argv[argi][1];
765 if (strcmp(optName,
"fileHandler") == 0)
767 handlerType = argv[argi+1];
772 if (handlerType.empty())
775 if (handlerType.empty())
787 )().needsThreading();
792 for (
int argi = 1; argi < argc; ++argi)
794 if (argv[argi][0] ==
'-')
796 const char *optName = &argv[argi][1];
798 if (validParOptions.found(optName))
800 parRunControl_.runPar(argc, argv, needsThread);
807 regroupArgv(argc, argv);
808 commandLine_ += args_[0];
815 for (
int argi = 1; argi < args_.size(); ++argi)
818 commandLine_ += args_[argi];
820 if (args_[argi][0] ==
'-')
822 const char *optName = &args_[argi][1];
827 <<
"Ignoring lone '-' on the command-line" <<
endl;
831 validOptions.lookup(optName,
"").size()
832 || validParOptions.lookup(optName,
"").size()
839 if (argi >= args_.size())
844 <<
"Error: option '-" << optName
845 <<
"' requires an argument" <<
nl <<
nl
846 <<
"See '" << executable_ <<
" -help' for usage"
853 commandLine_ += args_[argi];
855 if (strcmp(optName,
"lib") == 0)
859 libs_.append(this->getList<fileName>(argi));
861 else if (strcmp(optName,
"debug-switch") == 0)
869 else if (strcmp(optName,
"info-switch") == 0)
877 else if (strcmp(optName,
"opt-switch") == 0)
889 options_.set(optName, args_[argi]);
897 options_.insert(optName,
"");
904 args_[nArgs] = args_[argi];
912 parse(checkArgs, checkOpts, initialise);
925 parRunControl_(
args.parRunControl_),
929 executable_(
args.executable_),
930 rootPath_(
args.rootPath_),
931 globalCase_(
args.globalCase_),
933 commandLine_(
args.commandLine_)
935 parse(checkArgs, checkOpts, initialise);
953 bool quickExit =
false;
956 if (options_.found(
"doc"))
963 options_.found(
"doc-source")
964 || options_.found(
"srcDoc")
972 if (options_.found(
"help-full"))
977 else if (options_.found(
"help-notes"))
983 else if (options_.found(
"help"))
988 else if (options_.found(
"help-man"))
995 if (options_.found(
"help-compat"))
1008 if (!check(checkArgs, checkOpts))
1042 <<
"Exec : " << commandLine_.c_str() <<
nl
1043 <<
"Date : " << dateString.c_str() <<
nl
1044 <<
"Time : " << timeString.c_str() <<
nl
1062 const auto space =
build.find(
' ');
1063 if (space != std::string::npos)
1065 build.resize(space);
1071 libs_.open(bannerEnabled());
1085 options_.lookup(
"fileHandler",
Foam::getEnv(
"FOAM_FILEHANDLER"))
1088 if (handlerType.empty())
1102 if (parRunControl_.parRun())
1120 fromSlave >> slaveBuild >> slaveMachine[proci] >> slavePid;
1122 slaveProcs[proci] = slaveMachine[proci] +
"." +
name(slavePid);
1130 <<
"; slave " << proci <<
" is running version "
1155 if (parRunControl_.parRun())
1165 fileName source = rootPath_/globalCase_/
"system"/
"decomposeParDict";
1166 if (options_.found(
"decomposeParDict"))
1168 bool adjustOpt =
false;
1170 source = options_[
"decomposeParDict"];
1173 source /=
"decomposeParDict";
1180 source = rootPath_/globalCase_/source;
1188 options_.set(
"decomposeParDict", source);
1193 label dictNProcs = -1;
1194 if (this->readListIfPresent(
"roots", roots))
1196 parRunControl_.distributed(
true);
1198 if (roots.size() != 1)
1200 dictNProcs = roots.size()+1;
1203 else if (options_.found(
"hostRoots"))
1207 source =
"-hostRoots";
1208 ITstream is(source, options_[
"hostRoots"]);
1211 checkITstream(is,
"hostRoots");
1213 for (
const auto& hostRoot : hostRoots)
1219 for (
const label slavei : matched)
1221 if (!roots[slavei].empty())
1224 <<
"Slave " << slaveMachine[slavei]
1225 <<
" has multiple matching roots in "
1229 roots[slavei] = hostRoot.second();
1236 if (roots[slavei].empty())
1239 <<
"Slave " << slaveMachine[slavei]
1240 <<
" has no matching roots in "
1245 if (roots.size() != 1)
1247 dictNProcs = roots.size()+1;
1250 else if (checkProcessorDirectories_)
1257 if (!decompDictStream.
good())
1260 <<
"Cannot read decomposeParDict from "
1261 << decompDictStream.
name()
1267 decompDict.
readEntry(
"numberOfSubdomains", dictNProcs);
1271 parRunControl_.distributed(
true);
1278 if (roots.size() == 1)
1286 dictNProcs = roots.size()+1;
1304 <<
" specifies " << dictNProcs
1305 <<
" processors but job was started with "
1317 <<
"number of entries in roots "
1319 <<
" is not equal to the number of slaves "
1330 const bool hadCaseOpt = options_.found(
"case");
1338 options_.set(
"case", roots[slave-1]/globalCase_);
1341 toSlave << args_ << options_ << roots.size();
1343 options_.erase(
"case");
1348 options_.set(
"case", rootPath_/globalCase_);
1357 checkProcessorDirectories_
1361 label nProcDirs = 0;
1366 rootPath_/globalCase_
1375 <<
"number of processor directories = "
1377 <<
" is not equal to the number of processors = "
1392 toSlave << args_ << options_ << roots.size();
1406 fromMaster >> args_ >> options_ >> nroots;
1408 parRunControl_.distributed(nroots);
1421 case_ = globalCase_;
1428 if (!writeHostsSwitch)
1441 Info<<
"Case : " << (rootPath_/globalCase_).c_str() <<
nl
1442 <<
"nProcs : " << nProcs <<
endl;
1444 if (parRunControl_.parRun())
1446 if (slaveProcs.size())
1448 if (writeHostsSwitch == 1)
1456 Info<<
"Slaves : " << slaveProcs <<
nl;
1461 Info<<
"Roots : " << roots <<
nl;
1463 Info<<
"Pstream initialized with:" <<
nl
1478 if (slaveProcs.size())
1497 Info<<
"fileModificationChecking : "
1498 <<
"Monitoring run-time modified files using "
1517 Info<<
" (fileModificationSkew "
1523 Info<<
" (fileModificationSkew "
1525 <<
", maxFileModificationPolls "
1532 <<
"Invalid setting for maxFileModificationPolls "
1539 Info<<
"allowSystemOperations : ";
1546 Info<<
"Disallowing";
1548 Info<<
" user-supplied system call operations" <<
nl
1572 for (
const word& optName : optionNames)
1574 if (options_.found(optName))
1585 std::initializer_list<word> optionNames
1589 for (
const word& optName : optionNames)
1591 if (options_.found(optName))
1606 || optName ==
"parallel"
1607 || optName ==
"roots"
1611 <<
"Option: '" << optName <<
"' is protected" <<
nl
1616 if (options_.found(optName) ? (options_[optName] != param) :
true)
1618 options_.set(optName, param);
1632 || optName ==
"parallel"
1633 || optName ==
"roots"
1634 || optName ==
"hostRoots"
1638 <<
"Option: '" << optName <<
"' is protected" <<
nl
1644 return options_.erase(optName);
1657 docExt.
replace(
".",
"_source.");
1662 for (
const fileName& dir : docDirs)
1665 if (dir.starts_with(
"http:") || dir.starts_with(
"https:"))
1667 url = dir/executable_ + docExt;
1676 ?
isFile(docFile.substr(7))
1680 url = std::move(docFile);
1688 <<
"No documentation found for " << executable_
1689 <<
", but you can use -help to display the usage\n" <<
endl;
1694 string docBrowser =
getEnv(
"FOAM_DOC_BROWSER");
1695 if (docBrowser.empty())
1697 docDict.
readEntry(
"docBrowser", docBrowser);
1701 if (docBrowser.find(
"%f") != std::string::npos)
1703 docBrowser.
replace(
"%f", url);
1707 docBrowser +=
" " + url;
1716 <<
" " << command <<
nl <<
endl;
1728 const label nargs = args_.size()-1;
1729 if (checkArgs && nargs != validArgs.size())
1732 <<
"Expected " << validArgs.size()
1733 <<
" arguments but found " << nargs <<
endl;
1741 const word& optName = iter.key();
1744 !validOptions.found(optName)
1745 && !validParOptions.found(optName)
1749 <<
"Invalid option: -" << optName <<
endl;
1759 <<
"See '" << executable_ <<
" -help' for usage"
1774 <<
": cannot open root directory " << rootPath()
1782 if (checkProcessorDirectories_ && pathDir.empty() &&
Pstream::master())
1788 <<
": cannot open case directory " <<
path()
static SLList< string > validArgs
A list of valid (mandatory) arguments.
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
label count(const UList< word > &optionNames) const
Return how many of the specified options were used.
static void set(bool verbose=false)
Activate SIGFPE signal handler when FOAM_SIGFPE is set.
static void noBanner()
Disable emitting the banner information.
static bool writeJobInfo
Global value for writeJobInfo enabled.
static std::string::size_type usageMin
Min indentation when displaying usage (default: 20)
const std::string build
OpenFOAM build information as a std::string.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
static constexpr int masterNo() noexcept
Process index of the master.
static void addUsage(const word &optName, const string &usage)
Add option usage information to optionUsage.
A class for handling words, derived from Foam::string.
Foam::argList::initValidTables dummyInitValidTables
static const Enum< fileCheckTypes > fileCheckTypesNames
Names for the fileCheckTypes.
static std::string::size_type usageMax
Max screen width when displaying usage (default: 80)
A class for handling file names.
static HashTable< std::pair< word, int > > validOptionsCompat
A list of aliases for options.
static fileName validate(const std::string &s, const bool doClean=true)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
constexpr const char *const group
Group name for atomic constants.
static fileName envGlobalPath()
Global case (directory) from environment variable.
Input from file stream, using an ISstream.
static Ostream & writeBanner(Ostream &os, bool noHint=false)
Write the standard OpenFOAM file/dictionary banner.
Output inter-processor communications stream.
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
virtual const fileName & name() const
Read/write access to the name of the stream.
static HashTable< string > optionUsage
Short description for validOptions.
static float fileModificationSkew
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static int maxFileModificationPolls
static void addNote(const string ¬e)
Add extra notes for the usage information.
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Specify an alias for the option name.
Extract command arguments and options from the supplied argc and argv parameters.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
const fileOperation & fileHandler()
Get current file handler.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable, return true on success.
static commsTypes defaultCommsType
Default commsType.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Foam::SubStrings< StringType > splitSpace(const StringType &str)
Split string into sub-strings at whitespace (TAB, NL, VT, FF, CR, SPC)
static void noMandatoryArgs()
Flag command arguments as being optional (non-mandatory)
string getEnv(const std::string &envName)
Get environment value for given envName.
#define forAll(list, i)
Loop across all elements in list.
argList(int &argc, char **&argv, bool checkArgs=argList::argsMandatory(), bool checkOpts=true, bool initialise=true)
pid_t pgid()
Return the group PID of this process.
static int allowSystemOperations
Flag if system operations are allowed.
static void ignoreOptionCompat(std::pair< const char *, int > compat, bool expectArg)
Specify an option to be ignored.
void setNamedInt(std::string name, int val, bool report=false)
Set named value, but also handle embedded name=value syntax.
void printBuildInfo(std::ostream &os, const bool full=true)
Print information about version, build, arch to output stream.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
string expand(const std::string &s, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
static void printHostsSubscription(const UList< string > &slaveProcs)
static autoPtr< fileOperation > New(const word &handlerType, bool verbose=false)
Select fileHandler-type.
Template class for non-intrusive linked lists.
static HashTable< string > validParOptions
A list of valid parallel options.
void parse(bool checkArgs, bool checkOpts, bool initialise)
static void noLibs()
Add the '-no-libs' command line option.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
string userName()
Return the user's login name.
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
An input stream of tokens.
bool setOption(const word &optName, const string ¶m="")
Set option directly (use with caution)
static int lastSlave(const label communicator=0)
Process index of last slave.
static void noJobInfo()
Suppress JobInfo, overriding controlDict setting.
messageStream Info
Information stream (uses stdout - output is on the master only)
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
word name(const complex &c)
Return string representation of complex.
static bool floatTransfer
pid_t pid()
Return the PID of this process.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
pid_t ppid()
Return the parent PID of this process.
static word postProcessOptionName
Standard name for the post-processing option.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
graph_traits< Graph >::vertices_size_type size_type
static void setAdvanced(const word &optName, bool advanced=true)
Set an existing option as being 'advanced' or normal.
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
void resize(const label newSize)
Adjust allocated size of list.
static void noCheckProcessorDirectories()
Remove checking of processor directories.
static HashTable< string > validOptions
A list of valid options.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
static bool postProcess(int argc, char *argv[])
Return true if the post-processing option is specified.
static std::string date()
static word defaultFileHandler
Default fileHandler.
labelList findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
int infoDetailLevel
Global for selective suppression of Info output.
static const fileName null
An empty fileName.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
bool unsetOption(const word &optName)
Unset option directly (use with caution)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
static int nProcsSimpleSum
static constexpr int firstSlave() noexcept
Process index of first slave.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static HashSet< string > advancedOptions
The "advanced" options are shown with -help-full (not with –help)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void warnAboutAge(const char *what, const int version)
Emit warning on stderr about something being old.
forAllConstIters(mixture.phases(), phase)
static bool argsMandatory()
Command arguments type (optional/mandatory).
const std::string patch
OpenFOAM patch number as a std::string.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
static void set(bool verbose=false)
Activate SIGSEGV signal handler.
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
const std::string buildArch
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
void clear()
Clear the list, i.e. set size to zero.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
static SLList< string > notes
General usage notes.
bool checkRootCase() const
Check root path and case path.
static std::string clockTime()
static bool clean(std::string &str)
Cleanup filename.
fileName cwd()
The physical or logical current working directory path name.
Operations on lists of strings.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Input inter-processor communications stream.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
static HashTable< std::pair< bool, int > > ignoreOptionsCompat
A list of options to ignore.
void write(Ostream &os, const bool includeTitle=true) const
Print error message.
dictionary & controlDict()
static HashTable< string, label, Hash< label > > argUsage
Short description for program arguments.
bool check(bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const
static void noParallel()
Remove the parallel options.
bool good() const
Return true if next operation might succeed.
static void set(bool verbose=false)
Activate SIGQUIT signal handler.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
static bool bannerEnabled()
Banner status (enabled/disabled).
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
static bool isAbsolute(const std::string &str)
Return true if string starts with a '/'.
virtual ~argList()
Destructor.
void displayDoc(bool source=false) const
Display documentation in browser.
static void set(bool verbose=false)
Activate SIGINT signal handler.
static void removeOption(const word &optName)
Remove option from validOptions and from optionUsage.
static int nPollProcInterfaces
Number of polling cycles in processor updates.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
static autoPtr< fileOperationInitialise > New(const word &type, int &argc, char **&argv)
Select type.
An adapter for copying a list of C++ strings into a list of C-style strings for passing to C code tha...