From f453b2bddd2a6d20ccf0017262ddcfe4a4a4a7dd Mon Sep 17 00:00:00 2001 From: TimQu Date: Mon, 20 May 2019 18:51:57 +0200 Subject: [PATCH] storm-conv: also don't print the help message in case of errors in storm-conv. --- src/storm-conv-cli/storm-conv.cpp | 4 +--- .../settings/modules/ConversionGeneralSettings.cpp | 8 ++++---- .../settings/modules/ConversionGeneralSettings.h | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/storm-conv-cli/storm-conv.cpp b/src/storm-conv-cli/storm-conv.cpp index d60895eff..1ef0823ea 100644 --- a/src/storm-conv-cli/storm-conv.cpp +++ b/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; } diff --git a/src/storm-conv/settings/modules/ConversionGeneralSettings.cpp b/src/storm-conv/settings/modules/ConversionGeneralSettings.cpp index 4f1c65e74..19ab31765 100644 --- a/src/storm-conv/settings/modules/ConversionGeneralSettings.cpp +++ b/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 { diff --git a/src/storm-conv/settings/modules/ConversionGeneralSettings.h b/src/storm-conv/settings/modules/ConversionGeneralSettings.h index dc7e79f27..343035382 100644 --- a/src/storm-conv/settings/modules/ConversionGeneralSettings.h +++ b/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.