diff --git a/algo/base/Options.cxx b/algo/base/Options.cxx index 2cdc945bbdbf287c98dc6c9fa99641695b0daafd..79fc95edaa37741fabfef741bf3365b1b9898115 100644 --- a/algo/base/Options.cxx +++ b/algo/base/Options.cxx @@ -77,14 +77,14 @@ Options::Options(int argc, char** argv) auto result = parser.run(); po::store(result, vm); } - catch (const boost::wrapexcept<po::unknown_option>& e) { + catch (const std::exception& e) { std::cerr << "Error: " << e.what() << std::endl; - std::cerr << cmdline_options << std::endl; + std::cerr << "Use '-h' to display all valid options." << std::endl; std::exit(EXIT_FAILURE); } - if (vm.count("help")) { - std::cerr << cmdline_options << std::endl; + if (vm.count("help") > 0) { + std::cout << cmdline_options << std::endl; std::exit(EXIT_SUCCESS); } @@ -93,7 +93,7 @@ Options::Options(int argc, char** argv) } catch (const po::required_option& e) { std::cerr << "Error: " << e.what() << std::endl; - std::cerr << cmdline_options << std::endl; + std::cerr << "Use '-h' to display all valid options." << std::endl; std::exit(EXIT_FAILURE); } }