1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

Dropping ERROR in simple printout

This commit is contained in:
Henry Fredrick Schreiner 2017-11-22 16:55:48 -05:00
parent 87425617cd
commit b45917e3e5
2 changed files with 2 additions and 2 deletions

View File

@ -1507,7 +1507,7 @@ class App {
namespace FailureMessage {
inline std::string simple(const App *app, const Error &e) {
std::string header = std::string("ERROR: ") + e.what() + "\n";
std::string header = e.what() + "\n";
if(app->get_help_ptr() != nullptr)
header += "Run with " + app->get_help_ptr()->single_name() + " for more information.\n";
return header;

View File

@ -435,7 +435,7 @@ TEST_F(CapturedHelp, NormalError) {
EXPECT_EQ(run(CLI::ExtrasError("Thing")), static_cast<int>(CLI::ExitCodes::Extras));
EXPECT_EQ(out.str(), "");
EXPECT_THAT(err.str(), HasSubstr("for more information"));
EXPECT_THAT(err.str(), HasSubstr("ERROR: ExtrasError"));
EXPECT_THAT(err.str(), HasSubstr("ExtrasError"));
EXPECT_THAT(err.str(), HasSubstr("Thing"));
EXPECT_THAT(err.str(), Not(HasSubstr("Usage")));
}