ENH: argList improvements

- argList::envExecutable() static method.
  This is identical to getEnv("FOAM_EXECUTABLE"), where the name of
  the executable has typically been set from the argList construction.

  Provides a singleton access to this value from locations that
  do not have knowledge of the originating command args (argList).
  This is a similar rationale as for the argList::envGlobalPath() static.

- additional argList::envRelativePath() static method.

- make -dry-run handling more central and easier to use by adding into
  argList itself.

STYLE: drop handling of -srcDoc (v1706 option)

- replaced with -doc-source for 1712 and never used much anyhow
This commit is contained in:
Mark Olesen
2021-11-01 11:31:56 +01:00
parent a19f03a5cb
commit b364a9e72c
23 changed files with 226 additions and 123 deletions

View File

@ -119,9 +119,8 @@ int main(int argc, char *argv[])
"len",
"Visualization length for planes (visualized as triangles)"
);
argList::addBoolOption
argList::addDryRunOption
(
"dry-run",
"Test movement without a mesh"
);
argList::addBoolOption
@ -142,7 +141,7 @@ int main(int argc, char *argv[])
const label span = Foam::max(1, args.getOrDefault<label>("span", 1));
// Control parameters
const bool dryrun = args.found("dry-run");
const bool dryrun = args.dryRun();
const bool slave = args.found("slave");
const bool removeLock = args.found("removeLock");