The GUI can be started from a terminal or a shortcut with options:
cppcheck-gui [OPTIONS] [files or paths]
| Option | Description |
|---|---|
-p <file> | Open the project file and analyze it. If the project has a build dir with earlier results, these are shown instead; click Reanalyze all files to analyze again. |
-l <file> | Open a results file in XML format. |
-d <directory> | Used with -l:
the folder that was analyzed to create the results file. Relative paths in
the results file are relative to this folder. It is needed to show the
source code of the warnings. |
-h, --help | Show a short description of the options. |
-v, --version | Show the version of the GUI. |
--data-dir=<directory> | Meant for installation scripts. Stores the folder where Cppcheck's data files (translations, library configurations, platforms, addons) are installed. The GUI is not started when this option is used. |
| files or paths | Analyze these files and folders without
a project. If one of the arguments is a project file
(*.cppcheck), it is opened as with -p. If one of
them is an XML file, it is opened as a results file. |
Open a project:
cppcheck-gui -p myproject.cppcheck
or simply:
cppcheck-gui myproject.cppcheck
Look at the results of a CI job. The job ran Cppcheck in the folder
/home/me/src/myproject and saved the results:
cppcheck-gui -l results.xml -d /home/me/src/myproject
Analyze a folder without a project:
cppcheck-gui src/
When the GUI is started without options, it opens the project that was open when it was closed last time, and shows the results of the last analysis if the project has a build dir.