fix a bug in commit 84a6fe6b54

This commit is contained in:
Daniel Marjamäki 2009-12-04 20:12:34 +01:00
parent e482cb561b
commit 737844d652
1 changed files with 6 additions and 4 deletions

View File

@ -116,12 +116,14 @@ bool Settings::isSuppressed(const std::string &errorId, const std::string &file,
void Settings::addEnabled(const std::string &str)
{
bool handled = false;
if (str == "all")
_checkCodingStyle = _showAll = _force = true;
handled = _checkCodingStyle = _showAll = _force = true;
else if (str == "style")
_checkCodingStyle = true;
handled = _checkCodingStyle = true;
else if (str == "possibleError")
_showAll = true;
handled = _showAll = true;
std::set<std::string> id;
id.insert("exceptNew");
@ -138,7 +140,7 @@ void Settings::addEnabled(const std::string &str)
{
_enabled[str] = true;
}
else
else if (!handled)
{
throw std::runtime_error("wrong --enable argument '" + str + "'");
}