Skip to content

Commit 87cff36

Browse files
committed
Updated manual and added test for reading file list from stdin.
1 parent 240ba01 commit 87cff36

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

man/cppcheck.1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Example: -DDEBUG=1 -D__cplusplus</para>
225225
<varlistentry>
226226
<term><option>--file-list=&lt;file&gt;</option></term>
227227
<listitem>
228-
<para>Specify the files to check in a text file. One filename per line.</para>
228+
<para>Specify the files to check in a text file. One filename per line. When file is -, the file list will be read from standard input.</para>
229229
</listitem>
230230
</varlistentry>
231231
<varlistentry>

test/testcmdlineparser.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class TestCmdlineParser : public TestFixture
7171
TEST_CASE(exitcodeSuppressions);
7272
TEST_CASE(exitcodeSuppressionsNoFile);
7373
TEST_CASE(fileList); // TODO: Create and test real file listing file
74+
TEST_CASE(fileListStdin);
7475
TEST_CASE(inlineSuppr);
7576
TEST_CASE(jobs);
7677
TEST_CASE(jobsMissingCount);
@@ -530,6 +531,16 @@ class TestCmdlineParser : public TestFixture
530531
CmdLineParser parser(&settings);
531532
TODO_ASSERT_EQUALS(true, false, parser.ParseFromArgs(4, argv));
532533
}
534+
535+
void fileListStdin()
536+
{
537+
// TODO: Give it some stdin to read from
538+
REDIRECT;
539+
const char *argv[] = {"cppcheck", "--file-list", "-", "file.cpp"};
540+
Settings settings;
541+
CmdLineParser parser(&settings);
542+
TODO_ASSERT_EQUALS(true, false, parser.ParseFromArgs(4, argv));
543+
}
533544

534545
void inlineSuppr()
535546
{

0 commit comments

Comments
 (0)