ENH: argList::getList with optional parameter

- this allows it to work like readListIfPresent() but with a list as
  the return value, which can be useful for a const context.
This commit is contained in:
Mark Olesen
2018-12-10 14:09:53 +01:00
parent a38b459ab0
commit 5415991e79
4 changed files with 24 additions and 12 deletions

View File

@ -288,8 +288,8 @@ int main(int argc, char *argv[])
Info<< "Subtracting mapped source field from target" << endl;
}
wordRes selectedFields;
args.readListIfPresent<wordRe>("fields", selectedFields);
// Non-mandatory
const wordRes selectedFields(args.getList<wordRe>("fields", false));
const bool noLagrangian = args.found("noLagrangian");