Filter out duplicate error messages in cli.

This commit is contained in:
Reijo Tomperi 2011-10-09 21:03:38 +03:00
parent 96beb94b21
commit e87628b72f
2 changed files with 10 additions and 0 deletions

View File

@ -255,6 +255,11 @@ int CppCheckExecutor::check(int argc, const char* const argv[])
void CppCheckExecutor::reportErr(const std::string &errmsg)
{
// Alert only about unique errors
if (std::find(_errorList.begin(), _errorList.end(), errmsg) != _errorList.end())
return;
_errorList.push_back(errmsg);
std::cerr << errmsg << std::endl;
}

View File

@ -107,6 +107,11 @@ protected:
private:
/**
* Used to filter out duplicate error messages.
*/
std::list<std::string> _errorList;
/**
* Report progress time
*/