|
| 1 | +<html> |
| 2 | +<head> |
| 3 | +<title>Command line options</title> |
| 4 | +<link rel="stylesheet" type="text/css" href="style.css"> |
| 5 | +</head> |
| 6 | +<body> |
| 7 | + |
| 8 | +<h1>Command line options</h1> |
| 9 | + |
| 10 | +<p>The GUI can be started from a terminal or a shortcut with options:</p> |
| 11 | + |
| 12 | +<pre>cppcheck-gui [OPTIONS] [files or paths]</pre> |
| 13 | + |
| 14 | +<table class="options" border="1" cellspacing="0" cellpadding="4" width="100%"> |
| 15 | +<tr><th>Option</th><th>Description</th></tr> |
| 16 | +<tr><td><code>-p <file></code></td><td>Open the project file and analyze |
| 17 | + it. If the project has a build dir with earlier results, these are shown |
| 18 | + instead; click <i>Reanalyze all files</i> to analyze again.</td></tr> |
| 19 | +<tr><td><code>-l <file></code></td><td>Open a results file in XML |
| 20 | + format.</td></tr> |
| 21 | +<tr><td><code>-d <directory></code></td><td>Used with <code>-l</code>: |
| 22 | + the folder that was analyzed to create the results file. Relative paths in |
| 23 | + the results file are relative to this folder. It is needed to show the |
| 24 | + source code of the warnings.</td></tr> |
| 25 | +<tr><td><code>-h</code>, <code>--help</code></td><td>Show a short description |
| 26 | + of the options.</td></tr> |
| 27 | +<tr><td><code>-v</code>, <code>--version</code></td><td>Show the version of |
| 28 | + the GUI.</td></tr> |
| 29 | +<tr><td><code>--data-dir=<directory></code></td><td>Meant for |
| 30 | + installation scripts. Stores the folder where Cppcheck's data files |
| 31 | + (translations, library configurations, platforms, addons) are installed. |
| 32 | + The GUI is not started when this option is used.</td></tr> |
| 33 | +<tr><td><i>files or paths</i></td><td>Analyze these files and folders without |
| 34 | + a project. If one of the arguments is a project file |
| 35 | + (<code>*.cppcheck</code>), it is opened as with <code>-p</code>. If one of |
| 36 | + them is an XML file, it is opened as a results file.</td></tr> |
| 37 | +</table> |
| 38 | + |
| 39 | +<h2>Examples</h2> |
| 40 | + |
| 41 | +<p>Open a project:</p> |
| 42 | +<pre>cppcheck-gui -p myproject.cppcheck</pre> |
| 43 | +<p>or simply:</p> |
| 44 | +<pre>cppcheck-gui myproject.cppcheck</pre> |
| 45 | + |
| 46 | +<p>Look at the results of a CI job. The job ran Cppcheck in the folder |
| 47 | +<code>/home/me/src/myproject</code> and saved the results:</p> |
| 48 | +<pre>cppcheck-gui -l results.xml -d /home/me/src/myproject</pre> |
| 49 | + |
| 50 | +<p>Analyze a folder without a project:</p> |
| 51 | +<pre>cppcheck-gui src/</pre> |
| 52 | + |
| 53 | +<h2>Starting without options</h2> |
| 54 | + |
| 55 | +<p>When the GUI is started without options, it opens the project that was open |
| 56 | +when it was closed last time, and shows the results of the last analysis if |
| 57 | +the project has a build dir.</p> |
| 58 | + |
| 59 | +<p class="nav">Previous: <a href="preferences.html">Preferences</a> | |
| 60 | +Next: <a href="troubleshooting.html">Troubleshooting</a></p> |
| 61 | + |
| 62 | +</body> |
| 63 | +</html> |
0 commit comments