2
|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>
|
|
2 |
<title>Running CodeScanner from the Command-line</title>
|
|
3 |
<link rel="StyleSheet" href="../book.css" type="text/css"/>
|
|
4 |
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
|
|
5 |
</head>
|
|
6 |
<body>
|
|
7 |
<div class="Head1">
|
|
8 |
<h2>Running CodeScanner from the Command-line</h2>
|
|
9 |
</div>
|
|
10 |
<p>CodeScanner can be run from a command prompt using the command, <span class="code">codescanner</span>, and appropriate
|
|
11 |
parameters and options. The output is in the form of HTML or XML files. </p>
|
|
12 |
<p>When CodeScanner is invoked from the command line it can scan files within any Symbian OS
|
|
13 |
project directory structure or within a single source file. </p>
|
|
14 |
<p>The options are: </p>
|
|
15 |
<table width="650"
|
|
16 |
border="0" cellpadding="2" cellspacing="0">
|
|
17 |
<tr valign="top">
|
|
18 |
<th width="151" class="Cell">Option</th>
|
|
19 |
<th width="489" class="Cell">Description</th>
|
|
20 |
</tr>
|
|
21 |
<tr valign="top">
|
|
22 |
<td class="code">-c <config file></td>
|
|
23 |
<td class="Cell">Specify a config file used by CodeScanner. </td>
|
|
24 |
</tr>
|
|
25 |
<tr valign="top">
|
|
26 |
<td class="code">-h</td>
|
|
27 |
<td class="Cell"><p>Display CodeScanner help. </p> </td>
|
|
28 |
</tr>
|
|
29 |
<tr valign="top">
|
|
30 |
<td class="code">-i <src dir|file> </td>
|
|
31 |
<td class="Cell"><p>Specify additional directory or file to scan. For example: </p>
|
|
32 |
<p class="listing">codescanner -i c:/myproject/includes c:/myproject/sources c:/myproject/results</p> </td>
|
|
33 |
</tr>
|
|
34 |
<tr valign="top">
|
|
35 |
<td class="code">-l <path|file> </td>
|
|
36 |
<td class="Cell">Creates debug log file of the specified filename in the same directory as the CodeScanner command-line tool. Include a path to specify another location to store the log file.</td>
|
|
37 |
</tr>
|
|
38 |
<tr valign="top">
|
|
39 |
<td class="code">-o html|xml|std </td>
|
|
40 |
<td class="Cell"><p>Specifies the output report format. Multiple formats can be set at the same time. Default setting is <span class="code">html</span>. For example:</p>
|
|
41 |
<p class="listing">codescanner -o xml,html c:\sources c:\reports</p></td>
|
|
42 |
</tr>
|
|
43 |
<tr valign="top">
|
|
44 |
<td class="code">outputdir </td>
|
|
45 |
<td class="Cell">The directory in which to produce the output HTML files. If omitted from the command-line, CodeScanner will only output the problems list and not generate a report. </td>
|
|
46 |
</tr>
|
|
47 |
<tr valign="top">
|
|
48 |
<td class="code">-r</td>
|
|
49 |
<td class="Cell">Used to specify the LXR version. </td>
|
|
50 |
</tr>
|
|
51 |
<tr valign="top">
|
|
52 |
<td class="code">sourcedir </td>
|
|
53 |
<td class="Cell"><p>The directory containing the source code.</p></td>
|
|
54 |
</tr>
|
|
55 |
<tr valign="top">
|
|
56 |
<td class="code">sourcefile</td>
|
|
57 |
<td class="Cell"> The single source file to scan, and its path.</td>
|
|
58 |
</tr>
|
|
59 |
<tr valign="top">
|
|
60 |
<td class="code">-t on|off </td>
|
|
61 |
<td class="Cell"><p>Creates a time-stamped directory for results. Default setting is on. For example:</p>
|
|
62 |
<p class="listing">codescanner -t off c:/myproject/sources c:/myproject/results</p></td>
|
|
63 |
</tr>
|
|
64 |
<tr valign="top">
|
|
65 |
<td class="code">-v</td>
|
|
66 |
<td class="Cell">Display verbose messages.</td>
|
|
67 |
</tr>
|
|
68 |
<tr valign="top">
|
|
69 |
<td class="code">-x</td>
|
|
70 |
<td class="Cell"><p>Used to specify the LXR site. Once scanning is complete, links in the report will point to the LXR server instead of the local directory (<span class="code">C:\sources</span>). For example:</p>
|
|
71 |
<p class="listing">codescanner -x http://some.lxr.server/sources/ -r S60_3_2_12 c:\sources c:\reports</p> </td>
|
|
72 |
</tr>
|
|
73 |
</table>
|
|
74 |
<div class="step">
|
|
75 |
<h4>Running CodeScanner on a directory</h4>
|
|
76 |
<ul>
|
|
77 |
<li>At the command prompt for your CodeScanner directory enter: <br />
|
|
78 |
<p class="listing">codescanner [options] <sourcedir> <outputdir></p></li>
|
|
79 |
</ul>
|
|
80 |
</div>
|
|
81 |
<p>For example: </p>
|
|
82 |
<p class="listing">codescanner -t C:\Projects\CodeToScan C:\Output </p>
|
|
83 |
<p>This example scans all of the text code files found in <span class="code">C:\Projects\CodeToScan</span> and saves the
|
|
84 |
HTML output to <span class="code">C:\Output</span>. No extra lines are displayed in the output to provide context for
|
|
85 |
the line containing each issue.</p>
|
|
86 |
<div class="step">
|
|
87 |
<h4>Running CodeScanner on a single source file</h4>
|
|
88 |
<ul>
|
|
89 |
<li>At the command prompt for your CodeScanner directory enter: <br />
|
|
90 |
<p class="listing">codescanner [options] <sourcefilewithpath> <outputdir></p></li>
|
|
91 |
</ul>
|
|
92 |
</div>
|
|
93 |
<p>For example: </p>
|
|
94 |
<p class="listing">codescanner c:\Projects\SingleFiles\Csymbianfile.cpp c:\tmp</p>
|
|
95 |
<p>This example scans the single file, <span class="code">Csymbianfile.cpp</span>, and saves the HTML output to
|
|
96 |
<span class="code">C:\tmp</span>. </p>
|
|
97 |
<b>Related references </b>
|
|
98 |
<ul>
|
|
99 |
<li><a href="run_cs.htm">Running CodeScanner </a></li>
|
|
100 |
</ul>
|
|
101 |
<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
|
|
102 |
</body>
|
|
103 |
</html>
|
|
104 |
|