Skip to content

Commit 267bdc0

Browse files
committed
Manual: -i and --project
1 parent 06752d7 commit 267bdc0

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

man/manual.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The second option is to use -i, with it you specify files/paths to ignore. With
9494

9595
cppcheck -isrc/c src
9696

97-
This option does not currently work with the `--project` option and is only valid when supplying an input directory. To ignore multiple directories supply the -i multiple times. The following command ignores both the src/b and src/c directories.
97+
This option is only valid when supplying an input directory. To ignore multiple directories supply the -i multiple times. The following command ignores both the src/b and src/c directories.
9898

9999
cppcheck -isrc/b -isrc/c
100100

@@ -138,6 +138,10 @@ You can import and use Cppcheck GUI project files in the command line tool:
138138

139139
The Cppcheck GUI has a few options that are not available in the command line directly. To use these options you can import a GUI project file. We want to keep the command line tool usage simple and limit the options by intention.
140140

141+
To ignore certain folders in the project you can use `-i`. This will skip analysis of source files in the `foo` folder.
142+
143+
cppcheck --project=foobar.cppcheck -ifoo
144+
141145
## CMake
142146

143147
Generate a compile database:
@@ -148,6 +152,11 @@ The file `compile_commands.json` is created in the current folder. Now run Cppch
148152

149153
cppcheck --project=compile_commands.json
150154

155+
To ignore certain folders you can use `-i`. This will skip analysis of source files in the `foo` folder.
156+
157+
cppcheck --project=compile_commands.json -ifoo
158+
159+
151160
## Visual Studio
152161

153162
You can run Cppcheck on individual project files (\*.vcxproj) or on a whole solution (\*.sln)
@@ -162,12 +171,21 @@ Running Cppcheck on a Visual Studio project:
162171

163172
In the `Cppcheck GUI` you have the choice to only analyze a single debug configuration. If you want to use this choice on the command line then create a `Cppcheck GUI` project with this activated and then import the GUI project file on the command line.
164173

174+
To ignore certain folders in the project you can use `-i`. This will skip analysis of source files in the `foo` folder.
175+
176+
cppcheck --project=foobar.vcxproj -ifoo
177+
165178
## C++ Builder 6
166179

167180
Running Cppcheck on a C++ Builder 6 project:
168181

169182
cppcheck --project=foobar.bpr
170183

184+
185+
To ignore certain folders in the project you can use `-i`. This will skip analysis of source files in the `foo` folder.
186+
187+
cppcheck --project=foobar.bpr -ifoo
188+
171189
## Other
172190

173191
If you can generate a compile database then it's possible to import that in Cppcheck.
@@ -182,7 +200,7 @@ You should use a platform configuration that match your target.
182200

183201
By default Cppcheck uses native platform configuration that works well if your code is compiled and executed locally.
184202

185-
Cppcheck has builtin configurations for Unix and Windows targets. You can easily use these with the --platform command line flag.
203+
Cppcheck has builtin configurations for Unix and Windows targets. You can easily use these with the `--platform` command line flag.
186204

187205
You can also create your own custom platform configuration in a XML file. Here is an example:
188206

0 commit comments

Comments
 (0)