From 9583394eba5c5681273207027957b131248e01d9 Mon Sep 17 00:00:00 2001 From: Joshua Beck Date: Tue, 27 Sep 2011 01:02:58 -0500 Subject: [PATCH] Fix test and add info to -h output. --- cli/cmdlineparser.cpp | 3 ++- test/testcmdlineparser.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 264ad7424..941c7dd9b 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -730,7 +730,8 @@ void CmdLineParser::PrintHelp() " Used when certain messages should be displayed but\n" " should not cause a non-zero exitcode.\n" " --file-list= Specify the files to check in a text file. Add one\n" - " filename per line.\n" + " filename per line. When file is -, the file list will\n" + " be read from standard input.\n" " -f, --force Force checking of all configurations in files that have\n" " \"too many\" configurations.\n" " -h, --help Print this help.\n" diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index af59fb011..aacae87e6 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -534,12 +534,13 @@ private: void fileListStdin() { - // TODO: Give it some stdin to read from + // TODO: Give it some stdin to read from, fails because the list of + // files in stdin (_pathnames) is empty REDIRECT; - const char *argv[] = {"cppcheck", "--file-list", "-", "file.cpp"}; + const char *argv[] = {"cppcheck", "--file-list=-", "file.cpp"}; Settings settings; CmdLineParser parser(&settings); - TODO_ASSERT_EQUALS(true, false, parser.ParseFromArgs(4, argv)); + TODO_ASSERT_EQUALS(true, false, parser.ParseFromArgs(3, argv)); } void inlineSuppr()