From 1f53018b8e7c4e3107c421bfedc46b82a4d97f1a Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 10 Jan 2014 21:50:21 +0100 Subject: [PATCH] Suppress warning about non-existing path given to -I with --quiet. --- cli/cppcheckexecutor.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 9912518ed..f39b8c8ba 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -80,9 +80,10 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c if (FileLister::isDirectory(path)) ++iter; else { - // If the include path is not found, warn user and remove the - // non-existing path from the list. - std::cout << "cppcheck: warning: Couldn't find path given by -I '" << path << '\'' << std::endl; + // If the include path is not found, warn user (unless --quiet + // was used) and remove the non-existing path from the list. + if (!settings._errorsOnly) + std::cout << "cppcheck: warning: Couldn't find path given by -I '" << path << '\'' << std::endl; iter = settings._includePaths.erase(iter); } }