Browse Source

storm-conv: also don't print the help message in case of errors in storm-conv.

tempestpy_adaptions
TimQu 6 years ago
parent
commit
f453b2bddd
  1. 4
      src/storm-conv-cli/storm-conv.cpp
  2. 8
      src/storm-conv/settings/modules/ConversionGeneralSettings.cpp
  3. 2
      src/storm-conv/settings/modules/ConversionGeneralSettings.h

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

@ -275,8 +275,6 @@ bool parseOptions(const int argc, const char* argv[]) {
try {
storm::settings::mutableManager().setFromCommandLine(argc, argv);
} catch (storm::exceptions::OptionParserException& e) {
storm::settings::manager().printHelp();
throw e;
return false;
}
@ -289,7 +287,7 @@ bool parseOptions(const int argc, const char* argv[]) {
bool result = true;
if (general.isHelpSet()) {
storm::settings::manager().printHelp(general.getHelpModuleName());
storm::settings::manager().printHelp(general.getHelpFilterExpression());
result = false;
}

8
src/storm-conv/settings/modules/ConversionGeneralSettings.cpp

@ -22,8 +22,8 @@ namespace storm {
const std::string ConversionGeneralSettings::configOptionShortName = "c";
ConversionGeneralSettings::ConversionGeneralSettings() : ModuleSettings(moduleName) {
this->addOption(storm::settings::OptionBuilder(moduleName, helpOptionName, false, "Shows all available options, arguments and descriptions.").setShortName(helpOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("hint", "A regular expression to show help for all matching entities or 'all' for the complete help.").setDefaultValueString("all").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, helpOptionName, false, "Shows available options, arguments and descriptions.").setShortName(helpOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filter", "'frequent' for frequently used options, 'all' for the complete help, or a regular expression to show help for all matching entities.").setDefaultValueString("frequent").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, versionOptionName, false, "Prints the version information.").build());
this->addOption(storm::settings::OptionBuilder(moduleName, verboseOptionName, false, "Enables more verbose output.").setShortName(verboseOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName, debugOptionName, false, "Enables verbose and debug output.").build());
@ -40,8 +40,8 @@ namespace storm {
return this->getOption(versionOptionName).getHasOptionBeenSet();
}
std::string ConversionGeneralSettings::getHelpModuleName() const {
return this->getOption(helpOptionName).getArgumentByName("hint").getValueAsString();
std::string ConversionGeneralSettings::getHelpFilterExpression() const {
return this->getOption(helpOptionName).getArgumentByName("filter").getValueAsString();
}
bool ConversionGeneralSettings::isVerboseSet() const {

2
src/storm-conv/settings/modules/ConversionGeneralSettings.h

@ -30,7 +30,7 @@ namespace storm {
*
* @return The name of the module for which to show the help or "all".
*/
std::string getHelpModuleName() const;
std::string getHelpFilterExpression() const;
/*!
* Retrieves whether the verbose option was set.

Loading…
Cancel
Save