diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index d550a005168cfb0a0612d380fc43cea9a9bc89de..7957bb66679ea4ea69eea9b60d975daf11c2bde5 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -52,6 +52,7 @@ License bool Foam::argList::argsMandatory_ = true; bool Foam::argList::checkProcessorDirectories_ = true; Foam::SLList<Foam::string> Foam::argList::validArgs; +Foam::HashSet<Foam::string> Foam::argList::advancedOptions; Foam::HashTable<Foam::string> Foam::argList::validOptions; Foam::HashTable<Foam::string> Foam::argList::validParOptions; Foam::HashTable<Foam::string> Foam::argList::optionUsage; @@ -234,10 +235,11 @@ void Foam::argList::addArgument(const string& argName) void Foam::argList::addBoolOption ( const word& optName, - const string& usage + const string& usage, + const bool advanced ) { - addOption(optName, "", usage); + addOption(optName, "", usage, advanced); } @@ -245,7 +247,8 @@ void Foam::argList::addOption ( const word& optName, const string& param, - const string& usage + const string& usage, + const bool advanced ) { validOptions.set(optName, param); @@ -253,6 +256,10 @@ void Foam::argList::addOption { optionUsage.set(optName, usage); } + if (advanced) + { + advancedOptions.set(optName); + } } @@ -314,6 +321,7 @@ void Foam::argList::removeOption(const word& optName) { validOptions.erase(optName); optionUsage.erase(optName); + advancedOptions.erase(optName); } @@ -361,7 +369,8 @@ void Foam::argList::noLibs() addBoolOption ( "no-libs", - "disable use of the controlDict libs entry" + "disable use of the controlDict libs entry", + true // advanced ); } @@ -427,7 +436,7 @@ void Foam::argList::printOptionUsage else if (isspace(str[curr+1])) { // The next one is a space - so we are okay - curr++; // otherwise the length is wrong + ++curr; // otherwise the length is wrong next = str.find_first_not_of(" \t\n", curr); } else @@ -1575,16 +1584,8 @@ void Foam::argList::printUsage(bool full) const for (const word& optName : validOptions.sortedToc()) { - // Ad hoc suppression of some options for regular (non-full) help - if - ( - !full - && - ( - // '-listXXX' and '-list-XXX' but not '-list' - (optName.size() > 4 && optName.startsWith("list")) - ) - ) + // Suppress advanced options for regular -help. + if (advancedOptions.found(optName) && !full) { continue; } diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index 7795e8927072d6f05dbbe5faffc2966ad693ba45..aff7e50d3e312e83b3ec2dd1c52f8bcfcfafb128 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -97,6 +97,7 @@ SourceFiles #include "stringList.H" #include "SubList.H" #include "SLList.H" +#include "HashSet.H" #include "HashTable.H" #include "word.H" #include "fileName.H" @@ -193,6 +194,9 @@ public: //- A list of valid (mandatory) arguments static SLList<string> validArgs; + //- The "advanced" options are shown with -help-full (not with --help) + static HashSet<string> advancedOptions; + //- A list of valid options static HashTable<string> validOptions; @@ -386,7 +390,8 @@ public: static void addBoolOption ( const word& optName, - const string& usage = "" + const string& usage = "", + const bool advanced = false ); //- Add an option to validOptions with usage information @@ -395,7 +400,8 @@ public: ( const word& optName, const string& param = "", - const string& usage = "" + const string& usage = "", + const bool advanced = false ); //- Specify an alias for the option name. diff --git a/src/OpenFOAM/include/listOptions.H b/src/OpenFOAM/include/listOptions.H index 49131de763c2cffcfcb8b9b95cc3d6a84c2d9b50..a9c32687543411ca32ab4a4d31ec9e98d514c842 100644 --- a/src/OpenFOAM/include/listOptions.H +++ b/src/OpenFOAM/include/listOptions.H @@ -1,29 +1,34 @@ argList::addBoolOption ( "listSwitches", - "List switches declared in libraries but not set in etc/controlDict" + "List switches declared in libraries but not set in etc/controlDict", + true // advanced ); argList::addBoolOption ( "listRegisteredSwitches", - "List switches registered for run-time modification" + "List switches registered for run-time modification", + true // advanced ); argList::addBoolOption ( "listUnsetSwitches", - "List switches declared in libraries but not set in etc/controlDict" + "List switches declared in libraries but not set in etc/controlDict", + true // advanced ); #ifdef fvPatchField_H argList::addBoolOption ( "listScalarBCs", - "List scalar field boundary conditions (fvPatchField<scalar>)" + "List scalar field boundary conditions (fvPatchField<scalar>)", + true // advanced ); argList::addBoolOption ( "listVectorBCs", - "List vector field boundary conditions (fvPatchField<vector>)" + "List vector field boundary conditions (fvPatchField<vector>)", + true // advanced ); #endif @@ -31,7 +36,8 @@ argList::addBoolOption argList::addBoolOption ( "listFunctionObjects", - "List functionObjects" + "List functionObjects", + true // advanced ); #endif @@ -39,7 +45,8 @@ argList::addBoolOption argList::addBoolOption ( "listFvOptions", - "List fvOptions" + "List fvOptions", + true // advanced ); #endif @@ -47,6 +54,7 @@ argList::addBoolOption argList::addBoolOption ( "listTurbulenceModels", - "List turbulenceModels" + "List turbulenceModels", + true // advanced ); #endif diff --git a/src/OpenFOAM/include/listOutput.H b/src/OpenFOAM/include/listOutput.H index 99057484e2aa75a9e004810feb293981b397dc0d..77553615f75cd08ac386a10a52c734c019803435 100644 --- a/src/OpenFOAM/include/listOutput.H +++ b/src/OpenFOAM/include/listOutput.H @@ -1,4 +1,4 @@ -bool listOptions = false ; +bool listOptions = false; if (