我正在运行以下命令:
"C:\Software\cloc 1.62\cloc-1.62.exe" "ProjectPath" --xml --exclude-dir=packages,bin,obj >> CodeCounttest.xml
显示如下结果:
100 files
135 text files.
classified 135 files
Duplicate file check 135 files (117 known unique)
Unique: 100 files
119 unique files.
Counting: 100
171 files ignored.
<?xml version="1.0"?><results>
<header>
<cloc_url>http://cloc.sourceforge.net</cloc_url>
<cloc_version>1.62</cloc_version>
<elapsed_seconds>8.29936003684998</elapsed_seconds>
<n_files>93</n_files>
<n_lines>126092</n_lines>
<files_per_second>11.2056832800446</files_per_second>
<lines_per_second>15192.9786682514</lines_per_second>
</header>
<languages>
<language name="XML" files_count="6" blank="51" comment="29" code="38966" />
<language name="Javascript" files_count="16" blank="5633" comment="8243" code="33120" />
<language name="TypeScript" files_count="15" blank="3849" comment="3017" code="17014" />
<language name="C#" files_count="20" blank="542" comment="525" code="3862" />
<language name="CSS" files_count="6" blank="260" comment="128" code="2562" />
<language name="MSBuild script" files_count="10" blank="0" comment="57" code="2197" />
<language name="WiX source" files_count="2" blank="7" comment="17" code="1946" />
<language name="Razor" files_count="5" blank="331" comment="960" code="1331" />
<language name="HTML" files_count="3" blank="76" comment="0" code="844" />
<language name="ASP.Net" files_count="8" blank="12" comment="0" code="327" />
<language name="JSON" files_count="1" blank="3" comment="0" code="29" />
<language name="PowerShell" files_count="1" blank="4" comment="139" code="11" />
<total sum_files="93" blank="10768" comment="13115" code="102209" />
</languages>
</results>
我只需要XML结果而不需要XML之前的信息。
如何排除?通过cloc
命令或者如果PowerShell中有一种方法可以单独获取XML那么这至少也可以吗?