Use argList::addOption, argList::addBoolOption (almost) everywhere

- ensure that the standard options (eg, from timeSelector) also have
  some usage information
This commit is contained in:
Mark Olesen
2009-12-03 13:32:12 +01:00
parent ca7acea5f4
commit 58b7e64185
93 changed files with 369 additions and 287 deletions

View File

@ -124,15 +124,37 @@ void Foam::timeSelector::addOptions
{
if (constant)
{
argList::validOptions.insert("constant", "");
argList::addBoolOption
(
"constant",
"include the 'constant/' dir in the times list"
);
}
if (zeroTime)
{
argList::validOptions.insert("zeroTime", "");
argList::addBoolOption
(
"zeroTime",
"include the '0/' dir in the times list"
);
}
argList::validOptions.insert("noZero", "");
argList::validOptions.insert("time", "ranges");
argList::validOptions.insert("latestTime", "");
argList::addBoolOption
(
"noZero",
"exclude the '0/' dir from the times list, "
"has precedence over the -zeroTime option"
);
argList::addBoolOption
(
"latestTime",
"select the latest time"
);
argList::addOption
(
"time",
"ranges",
"comma-separated time ranges - eg, ':10,20,40-70,1000:'"
);
}

View File

@ -2,4 +2,10 @@
// addRegionOption.H
// ~~~~~~~~~~~~~~~~~
Foam::argList::validOptions.insert("region", "name");
Foam::argList::addOption
(
"region",
"name",
"specify alternative mesh region"
);

View File

@ -2,7 +2,28 @@
// addTimeOptions.H
// ~~~~~~~~~~~~~~~~
Foam::argList::validOptions.insert("constant", "");
Foam::argList::validOptions.insert("latestTime", "");
Foam::argList::validOptions.insert("noZero", "");
Foam::argList::validOptions.insert("time", "time");
Foam::argList::addBoolOption
(
"constant",
"include the 'constant/' dir in the times list"
);
Foam::argList::addBoolOption
(
"latestTime",
"select the latest time"
);
Foam::argList::addBoolOption
(
"noZero",
"exclude the '0/' dir from the times list"
);
Foam::argList::addOption
(
"time",
"time",
"specify a single time value to select"
);

View File

@ -58,8 +58,16 @@ namespace Foam
int main(int argc, char *argv[])
{
Foam::timeSelector::addOptions();
Foam::argList::validOptions.insert("noWrite", "");
Foam::argList::validOptions.insert("dict", "dictionary name");
Foam::argList::addBoolOption
(
"noWrite",
"suppress writing results"
);
Foam::argList::addOption
(
"dict",
"dictionary name"
);
# include "setRootCase.H"
# include "createTime.H"