diff --git a/application.cpp b/application.cpp index 6e82eb07e..75a6573fb 100644 --- a/application.cpp +++ b/application.cpp @@ -471,7 +471,8 @@ void application::print_default_config(std::ostream& os) { os << "# " << od->long_name() << " = " << (boost::any_cast(store) ? "true" : "false") << std::endl; else { // The string is formatted "arg (=)" - example.erase(0, 6); + auto pos = example.find("(="); + if(pos != string::npos) example = example.substr(pos+2); if(!example.empty()) example.erase(example.length()-1); os << "# " << od->long_name() << " = " << example << std::endl; }