From abf25fcc699590354adf6feae1d2feaa9bb761c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 23 Oct 2011 10:47:18 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Signed-off-by:=20G=C3=BCnther=20Makulik=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/cmdlineparser.cpp | 3 +++ man/cppcheck.1.xml | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 126246cbf..89ea20798 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -708,6 +708,9 @@ void CmdLineParser::PrintHelp() " -I Give include path. Give several -I parameters to give\n" " several paths. First given path is checked first. If\n" " paths are relative to source files, this is not needed.\n" + " --includes-file=\n" + " Specify the include paths to check in a text file. Add\n" + " one include path per line.\n" " -i Give a source file or source file directory to exclude\n" " from the check. This applies only to source files so\n" " header files included by source files are not matched.\n" diff --git a/man/cppcheck.1.xml b/man/cppcheck.1.xml index bb9884f42..a1ef6d765 100644 --- a/man/cppcheck.1.xml +++ b/man/cppcheck.1.xml @@ -113,6 +113,7 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ + @@ -271,7 +272,13 @@ default. If used together with --max-ifdefs=, the last option is the one that is files, this is not needed. - + + + + Specify the include paths to check in a text file. Add one include path per line. + + + From c7ed1de41923eb8240b6010ec446e2ce6ab45e9a Mon Sep 17 00:00:00 2001 From: makulik Date: Sun, 23 Oct 2011 11:15:12 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Signed-off-by:=20G=C3=BCnther=20Makulik=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/cmdlineparser.cpp | 17 ++++++----------- test/testcmdlineparser.cpp | 3 +-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 89ea20798..c79efde07 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -68,13 +68,10 @@ static void AddInclPathsToList(const std::string& FileList, std::list_includePaths.push_back(path); - } - else if (strncmp(argv[i], "--includes-file=", 16) == 0) - { + } else if (strncmp(argv[i], "--includes-file=", 16) == 0) { // open this file and read every input file (1 file name per line) AddInclPathsToList(16 + argv[i], _settings->_includePaths); } @@ -708,8 +703,8 @@ void CmdLineParser::PrintHelp() " -I Give include path. Give several -I parameters to give\n" " several paths. First given path is checked first. If\n" " paths are relative to source files, this is not needed.\n" - " --includes-file=\n" - " Specify the include paths to check in a text file. Add\n" + " --includes-file=\n" + " Specify the include paths to check in a text file. Add\n" " one include path per line.\n" " -i Give a source file or source file directory to exclude\n" " from the check. This applies only to source files so\n" diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index a06a2e730..c0947c2c1 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -366,8 +366,7 @@ private: ASSERT_EQUALS("framework/", settings._includePaths.front()); } - void includesFile() - { + void includesFile() { // TODO: Fails since cannot open the file REDIRECT; const char *argv[] = {"cppcheck", "--includes-file=inclpaths.txt", "file.cpp"};