Browse Source

Settings: Do not hard-code executable name in help message.

tempestpy_adaptions
TimQu 6 years ago
parent
commit
b6a5fcfd84
  1. 2
      src/storm-cli-utilities/cli.cpp
  2. 1
      src/storm-conv-cli/storm-conv.cpp
  3. 25
      src/storm/settings/SettingsManager.cpp

2
src/storm-cli-utilities/cli.cpp

@ -177,7 +177,7 @@ namespace storm {
try {
storm::settings::mutableManager().setFromCommandLine(argc, argv);
} catch (storm::exceptions::OptionParserException& e) {
STORM_LOG_ERROR("Unable to parse command line options. Type 'storm --help' or 'storm --help all' for help.");
STORM_LOG_ERROR("Unable to parse command line options. Type '" + std::string(argv[0]) + " --help' or '" + std::string(argv[0]) + " --help all' for help.");
return false;
}

1
src/storm-conv-cli/storm-conv.cpp

@ -275,6 +275,7 @@ bool parseOptions(const int argc, const char* argv[]) {
try {
storm::settings::mutableManager().setFromCommandLine(argc, argv);
} catch (storm::exceptions::OptionParserException& e) {
STORM_LOG_ERROR("Unable to parse command line options. Type '" + std::string(argv[0]) + " --help' or '" + std::string(argv[0]) + " --help all' for help.");
return false;
}

25
src/storm/settings/SettingsManager.cpp

@ -240,15 +240,22 @@ namespace storm {
}
}
}
if (numHidden > 0) {
STORM_PRINT(numHidden << " hidden options." << std::endl);
}
if (!invisibleModules.empty()) {
STORM_PRINT(invisibleModules.size() << " hidden modules (" << boost::join(invisibleModules, ", ") << ")." << std::endl);
}
if (numHidden > 0 || !invisibleModules.empty()) {
STORM_PRINT(std::endl << "Type 'storm --help modulename' to display all options of a specific module or 'storm --help all' for a complete list of options." << std::endl);
}
if (!includeAdvanced) {
if (numHidden == 1) {
STORM_PRINT(numHidden << " hidden option." << std::endl);
} else {
STORM_PRINT(numHidden << " hidden options." << std::endl);
}
if (!invisibleModules.empty()) {
if (invisibleModules.size() == 1) {
STORM_PRINT(invisibleModules.size() << " hidden module (" << boost::join(invisibleModules, ", ") << ")." << std::endl);
} else {
STORM_PRINT(invisibleModules.size() << " hidden modules (" << boost::join(invisibleModules, ", ") << ")." << std::endl);
}
}
STORM_PRINT(std::endl << "Type '" + executableName + " --help modulename' to display all options of a specific module." << std::endl);
STORM_PRINT("Type '" + executableName + " --help all' to display a complete list of options." << std::endl);
}
} else {
// Create a regular expression from the input hint.
std::regex hintRegex(filter, std::regex_constants::ECMAScript | std::regex_constants::icase);

Loading…
Cancel
Save