Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
CLI::FailureMessage Namespace Reference

Functions

std::string simple (const App *app, const Error &e)
 Printout a clean, simple message on error (the default in CLI11 1.5+)
 
std::string help (const App *app, const Error &e)
 Printout the full help string on error (if this fn is set, the old default for CLI11)
 

Function Documentation

◆ help()

std::string CLI::FailureMessage::help ( const App * app,
const Error & e )
inline

Definition at line 7593 of file CLI11.hpp.

7593 {
7594 std::string header = std::string("ERROR: ") + e.get_name() + ": " + e.what() + "\n";
7595 header += app->help();
7596 return header;
7597}
std::string get_name() const
Definition CLI11.hpp:575
Here is the call graph for this function:

◆ simple()

std::string CLI::FailureMessage::simple ( const App * app,
const Error & e )
inline

Definition at line 7574 of file CLI11.hpp.

7574 {
7575 std::string header = std::string(e.what()) + "\n";
7576 std::vector<std::string> names;
7577
7578 // Collect names
7579 if(app->get_help_ptr() != nullptr)
7580 names.push_back(app->get_help_ptr()->get_name());
7581
7582 if(app->get_help_all_ptr() != nullptr)
7583 names.push_back(app->get_help_all_ptr()->get_name());
7584
7585 // If any names found, suggest those
7586 if(!names.empty())
7587 header += "Run with " + detail::join(names, " or ") + " for more information.\n";
7588
7589 return header;
7590}
Here is the call graph for this function: