patrick
/
plasp
Archived
1
0
Fork 0

Added error message when using command-line options incorrectly.

This commit is contained in:
Patrick Lühne 2016-06-14 18:47:02 +02:00
parent 0a205680fe
commit 853d7471c2
1 changed files with 16 additions and 0 deletions

View File

@ -76,6 +76,15 @@ int main(int argc, char **argv)
logger.setWarningLevel(plasp::utils::Logger::WarningLevel::Error);
else if (warningLevel == "ignore")
logger.setWarningLevel(plasp::utils::Logger::WarningLevel::Ignore);
else if (warningLevel == "normal")
logger.setWarningLevel(plasp::utils::Logger::WarningLevel::Normal);
else
{
logger.logError("unknown warning level “" + warningLevel + "");
std::cout << std::endl;
printHelp();
return EXIT_FAILURE;
}
const auto colorPolicy = variablesMap["color"].as<std::string>();
@ -85,6 +94,13 @@ int main(int argc, char **argv)
logger.setColorPolicy(plasp::utils::LogStream::ColorPolicy::Never);
else if (colorPolicy == "always")
logger.setColorPolicy(plasp::utils::LogStream::ColorPolicy::Always);
else
{
logger.logError("unknown color policy “" + colorPolicy + "");
std::cout << std::endl;
printHelp();
return EXIT_FAILURE;
}
try
{