Skip to content

Commit 1f53018

Browse files
kdudkadanmar
authored andcommitted
Suppress warning about non-existing path given to -I with --quiet.
1 parent 2f30f9a commit 1f53018

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cli/cppcheckexecutor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
8080
if (FileLister::isDirectory(path))
8181
++iter;
8282
else {
83-
// If the include path is not found, warn user and remove the
84-
// non-existing path from the list.
85-
std::cout << "cppcheck: warning: Couldn't find path given by -I '" << path << '\'' << std::endl;
83+
// If the include path is not found, warn user (unless --quiet
84+
// was used) and remove the non-existing path from the list.
85+
if (!settings._errorsOnly)
86+
std::cout << "cppcheck: warning: Couldn't find path given by -I '" << path << '\'' << std::endl;
8687
iter = settings._includePaths.erase(iter);
8788
}
8889
}

0 commit comments

Comments
 (0)