Commit cc587fc6 authored by Mathieu Giraud's avatar Mathieu Giraud

vidjil.cpp: better CLI11 error messages, using ERROR_STRING and DOCUMENTATION

define and use failure_message_doc(), taking inspiration from FailureMessage::simple()

see #3775
parent ee010248
......@@ -163,6 +163,14 @@ string usage_examples(char *progname)
return ss.str();
}
inline std::string failure_message_doc(const CLI::App *app, const CLI::Error &e) {
std::string header = ERROR_STRING + std::string(e.what()) + "\n";
header += "For more information, ";
if(app->get_help_ptr() != nullptr)
header += "run with " + app->get_help_ptr()->single_name() + " or ";
header += "see " DOCUMENTATION ".\n";
return header;
}
int atoi_NO_LIMIT(const char *optarg)
{
......@@ -216,6 +224,7 @@ int main (int argc, char **argv)
#endif
CLI::App app{"# vidjil-algo -- V(D)J recombinations analysis", argv[0]};
app.set_failure_message(failure_message_doc);
//$$ options: defaults
float ratio_representative = DEFAULT_RATIO_REPRESENTATIVE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment