You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1009 lines
70 KiB

<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Call <code>cloc.pl</code> directly with granular control over options — cloc_call • cloc</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Call <code>cloc.pl</code> directly with granular control over options — cloc_call" />
<meta property="og:description" content="It is nigh impossible to predict all use-cases for the cloc.pl acript and
create associated R functions for them. To that end, this function provides direct
access to the script and enables direct passing of command-line parameters
via processx::run()." />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">cloc</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.3.0</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Call <code>cloc.pl</code> directly with granular control over options</h1>
<div class="hidden name"><code>cloc_call.Rd</code></div>
</div>
<div class="ref-description">
<p>It is nigh impossible to predict all use-cases for the <code>cloc.pl</code> acript and
create associated R functions for them. To that end, this function provides direct
access to the script and enables direct passing of command-line parameters
via <code><a href='https://www.rdocumentation.org/packages/processx/topics/run'>processx::run()</a></code>.</p>
</div>
<pre class="usage"><span class='fu'>cloc_call</span>(<span class='kw'>args</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/character'>character</a></span>(), <span class='kw'>echo</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)
<span class='fu'>cloc_help</span>(<span class='kw'>echo</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>cloc_version</span>(<span class='kw'>echo</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)
<span class='fu'>cloc_os</span>(<span class='kw'>echo</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>args, </th>
<td><p>character vector, arguments to the command. They will be escaped
via <code><a href='https://www.rdocumentation.org/packages/base/topics/shQuote'>base::shQuote()</a></code>.</p></td>
</tr>
<tr>
<th>echo</th>
<td><p>echo Whether to print the standard output and error to the screen.
Note that the order of the standard output and error lines are not necessarily
correct, as standard output is typically buffered.</p></td>
</tr>
<tr>
<th>...</th>
<td><p>other options/parameters passed on to <code><a href='https://www.rdocumentation.org/packages/processx/topics/run'>processx::run()</a></code></p></td>
</tr>
</table>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>the structure returned by <code><a href='https://www.rdocumentation.org/packages/processx/topics/run'>processx::run()</a></code> (a list with four elements).</p>
<h2 class="hasAnchor" id="caveat-utilitor"><a class="anchor" href="#caveat-utilitor"></a>Caveat utilitor</h2>
<p>As indicated, this is an lower-level function providing granular control over
the options for <code>cloc.pl</code>. You are invoking an operating system command-line
and need to read the <code>cloc.pl</code> help very carefully as --- unlike the higher-level
functions -- there are no "guide railss" provided to do helpful things such as e
nsure you do not clobber files in a given directory.</p>
<p><code><a href='https://www.rdocumentation.org/packages/processx/topics/run'>processx::run()</a></code> supports "callback functions" to make it easier to deal with
stdout and stderr and you may need to make use of those depending on the how
you are calling the underlying script.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># Get help on the parameters `cloc.pl` supports</span>
<span class='fu'>cloc_call</span>(<span class='st'>"--help"</span>, <span class='kw'>echo_cmd</span><span class='kw'>=</span><span class='fl'>TRUE</span>, <span class='kw'>echo</span><span class='kw'>=</span><span class='fl'>TRUE</span>)</div><div class='output co'>#&gt; Running /usr/local/bin/perl /Users/bob/packages/cloc/inst/bin/cloc.pl --help
#&gt;
#&gt; Usage: cloc.pl [options] &lt;file(s)/dir(s)/git hash(es)&gt; | &lt;set 1&gt; &lt;set 2&gt; | &lt;report files&gt;
#&gt;
#&gt; Count, or compute differences of, physical lines of source code in the
#&gt; given files (may be archives such as compressed tarballs or zip files,
#&gt; or git commit hashes or branch names) and/or recursively below the
#&gt; given directories.
#&gt;
#&gt; Input Options
#&gt; --extract-with=&lt;cmd&gt; This option is only needed if cloc is unable
#&gt; to figure out how to extract the contents of
#&gt; the input file(s) by itself.
#&gt; Use &lt;cmd&gt; to extract binary archive files (e.g.:
#&gt; .tar.gz, .zip, .Z). Use the literal '&gt;FILE&lt;' as
#&gt; a stand-in for the actual file(s) to be
#&gt; extracted. For example, to count lines of code
#&gt; in the input files
#&gt; gcc-4.2.tar.gz perl-5.8.8.tar.gz
#&gt; on Unix use
#&gt; --extract-with='gzip -dc &gt;FILE&lt; | tar xf -'
#&gt; or, if you have GNU tar,
#&gt; --extract-with='tar zxf &gt;FILE&lt;'
#&gt; and on Windows use, for example:
#&gt; --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o &gt;FILE&lt; ."
#&gt; (if WinZip is installed there).
#&gt; --list-file=&lt;file&gt; Take the list of file and/or directory names to
#&gt; process from &lt;file&gt;, which has one file/directory
#&gt; name per line. Only exact matches are counted;
#&gt; relative path names will be resolved starting from
#&gt; the directory where cloc is invoked.
#&gt; See also --exclude-list-file.
#&gt; --vcs=&lt;VCS&gt; Invoke a system call to &lt;VCS&gt; to obtain a list of
#&gt; files to work on. If &lt;VCS&gt; is 'git', then will
#&gt; invoke 'git ls-files' to get a file list and
#&gt; 'git submodule status' to get a list of submodules
#&gt; whose contents will be ignored. See also --git
#&gt; which accepts git commit hashes and branch names.
#&gt; If &lt;VCS&gt; is 'svn' then will invoke 'svn list -R'.
#&gt; The primary benefit is that cloc will then skip
#&gt; files explicitly excluded by the versioning tool
#&gt; in question, ie, those in .gitignore or have the
#&gt; svn:ignore property.
#&gt; Alternatively &lt;VCS&gt; may be any system command
#&gt; that generates a list of files.
#&gt; Note: cloc must be in a directory which can read
#&gt; the files as they are returned by &lt;VCS&gt;. cloc will
#&gt; not download files from remote repositories.
#&gt; 'svn list -R' may refer to a remote repository
#&gt; to obtain file names (and therefore may require
#&gt; authentication to the remote repository), but
#&gt; the files themselves must be local.
#&gt; --unicode Check binary files to see if they contain Unicode
#&gt; expanded ASCII text. This causes performance to
#&gt; drop noticeably.
#&gt;
#&gt; Processing Options
#&gt; --autoconf Count .in files (as processed by GNU autoconf) of
#&gt; recognized languages. See also --no-autogen.
#&gt; --by-file Report results for every source file encountered.
#&gt; --by-file-by-lang Report results for every source file encountered
#&gt; in addition to reporting by language.
#&gt; --config &lt;file&gt; Read command line switches from &lt;file&gt; instead of
#&gt; the default location of /Users/bob/.config/cloc/options.txt.
#&gt; The file should contain one switch, along with
#&gt; arguments (if any), per line. Blank lines and lines
#&gt; beginning with '#' are skipped. Options given on
#&gt; the command line take priority over entries read from
#&gt; the file.
#&gt; --count-and-diff &lt;set1&gt; &lt;set2&gt;
#&gt; First perform direct code counts of source file(s)
#&gt; of &lt;set1&gt; and &lt;set2&gt; separately, then perform a diff
#&gt; of these. Inputs may be pairs of files, directories,
#&gt; or archives. If --out or --report-file is given,
#&gt; three output files will be created, one for each
#&gt; of the two counts and one for the diff. See also
#&gt; --diff, --diff-alignment, --diff-timeout,
#&gt; --ignore-case, --ignore-whitespace.
#&gt; --diff &lt;set1&gt; &lt;set2&gt; Compute differences in code and comments between
#&gt; source file(s) of &lt;set1&gt; and &lt;set2&gt;. The inputs
#&gt; may be any mix of files, directories, archives,
#&gt; or git commit hashes. Use --diff-alignment to
#&gt; generate a list showing which file pairs where
#&gt; compared. See also --count-and-diff, --diff-alignment,
#&gt; --diff-timeout, --ignore-case, --ignore-whitespace.
#&gt; --diff-timeout &lt;N&gt; Ignore files which take more than &lt;N&gt; seconds
#&gt; to process. Default is 10 seconds. Setting &lt;N&gt;
#&gt; to 0 allows unlimited time. (Large files with many
#&gt; repeated lines can cause Algorithm::Diff::sdiff()
#&gt; to take hours.)
#&gt; --follow-links [Unix only] Follow symbolic links to directories
#&gt; (sym links to files are always followed).
#&gt; --force-lang=&lt;lang&gt;[,&lt;ext&gt;]
#&gt; Process all files that have a &lt;ext&gt; extension
#&gt; with the counter for language &lt;lang&gt;. For
#&gt; example, to count all .f files with the
#&gt; Fortran 90 counter (which expects files to
#&gt; end with .f90) instead of the default Fortran 77
#&gt; counter, use
#&gt; --force-lang="Fortran 90",f
#&gt; If &lt;ext&gt; is omitted, every file will be counted
#&gt; with the &lt;lang&gt; counter. This option can be
#&gt; specified multiple times (but that is only
#&gt; useful when &lt;ext&gt; is given each time).
#&gt; See also --script-lang, --lang-no-ext.
#&gt; --force-lang-def=&lt;file&gt; Load language processing filters from &lt;file&gt;,
#&gt; then use these filters instead of the built-in
#&gt; filters. Note: languages which map to the same
#&gt; file extension (for example:
#&gt; MATLAB/Mathematica/Objective C/MUMPS/Mercury;
#&gt; Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog)
#&gt; will be ignored as these require additional
#&gt; processing that is not expressed in language
#&gt; definition files. Use --read-lang-def to define
#&gt; new language filters without replacing built-in
#&gt; filters (see also --write-lang-def,
#&gt; --write-lang-def-incl-dup).
#&gt; --git Forces the inputs to be interpreted as git targets
#&gt; (commit hashes, branch names, et cetera) if these
#&gt; are not first identified as file or directory
#&gt; names. This option overrides the --vcs=git logic
#&gt; if this is given; in other words, --git gets its
#&gt; list of files to work on directly from git using
#&gt; the hash or branch name rather than from
#&gt; 'git ls-files'. This option can be used with
#&gt; --diff to perform line count diffs between git
#&gt; commits, or between a git commit and a file,
#&gt; directory, or archive. Use -v/--verbose to see
#&gt; the git system commands cloc issues.
#&gt; --ignore-whitespace Ignore horizontal white space when comparing files
#&gt; with --diff. See also --ignore-case.
#&gt; --ignore-case Ignore changes in case; consider upper- and lower-
#&gt; case letters equivalent when comparing files with
#&gt; --diff. See also --ignore-whitespace.
#&gt; --lang-no-ext=&lt;lang&gt; Count files without extensions using the &lt;lang&gt;
#&gt; counter. This option overrides internal logic
#&gt; for files without extensions (where such files
#&gt; are checked against known scripting languages
#&gt; by examining the first line for #!). See also
#&gt; --force-lang, --script-lang.
#&gt; --max-file-size=&lt;MB&gt; Skip files larger than &lt;MB&gt; megabytes when
#&gt; traversing directories. By default, &lt;MB&gt;=100.
#&gt; cloc's memory requirement is roughly twenty times
#&gt; larger than the largest file so running with
#&gt; files larger than 100 MB on a computer with less
#&gt; than 2 GB of memory will cause problems.
#&gt; Note: this check does not apply to files
#&gt; explicitly passed as command line arguments.
#&gt; --no-autogen[=list] Ignore files generated by code-production systems
#&gt; such as GNU autoconf. To see a list of these files
#&gt; (then exit), run with --no-autogen list
#&gt; See also --autoconf.
#&gt; --original-dir [Only effective in combination with
#&gt; --strip-comments] Write the stripped files
#&gt; to the same directory as the original files.
#&gt; --read-binary-files Process binary files in addition to text files.
#&gt; This is usually a bad idea and should only be
#&gt; attempted with text files that have embedded
#&gt; binary data.
#&gt; --read-lang-def=&lt;file&gt; Load new language processing filters from &lt;file&gt;
#&gt; and merge them with those already known to cloc.
#&gt; If &lt;file&gt; defines a language cloc already knows
#&gt; about, cloc's definition will take precedence.
#&gt; Use --force-lang-def to over-ride cloc's
#&gt; definitions (see also --write-lang-def,
#&gt; --write-lang-def-incl-dup).
#&gt; --script-lang=&lt;lang&gt;,&lt;s&gt; Process all files that invoke &lt;s&gt; as a #!
#&gt; scripting language with the counter for language
#&gt; &lt;lang&gt;. For example, files that begin with
#&gt; #!/usr/local/bin/perl5.8.8
#&gt; will be counted with the Perl counter by using
#&gt; --script-lang=Perl,perl5.8.8
#&gt; The language name is case insensitive but the
#&gt; name of the script language executable, &lt;s&gt;,
#&gt; must have the right case. This option can be
#&gt; specified multiple times. See also --force-lang,
#&gt; --lang-no-ext.
#&gt; --sdir=&lt;dir&gt; Use &lt;dir&gt; as the scratch directory instead of
#&gt; letting File::Temp chose the location. Files
#&gt; written to this location are not removed at
#&gt; the end of the run (as they are with File::Temp).
#&gt; --skip-uniqueness Skip the file uniqueness check. This will give
#&gt; a performance boost at the expense of counting
#&gt; files with identical contents multiple times
#&gt; (if such duplicates exist).
#&gt; --stdin-name=&lt;file&gt; Give a file name to use to determine the language
#&gt; for standard input. (Use - as the input name to
#&gt; receive source code via STDIN.)
#&gt; --strip-comments=&lt;ext&gt; For each file processed, write to the current
#&gt; directory a version of the file which has blank
#&gt; and commented lines removed (in-line comments
#&gt; persist). The name of each stripped file is the
#&gt; original file name with .&lt;ext&gt; appended to it.
#&gt; It is written to the current directory unless
#&gt; --original-dir is on.
#&gt; --strip-str-comments Replace comment markers embedded in strings with
#&gt; 'xx'. This attempts to work around a limitation
#&gt; in Regexp::Common::Comment where comment markers
#&gt; embedded in strings are seen as actual comment
#&gt; markers and not strings, often resulting in a
#&gt; 'Complex regular subexpression recursion limit'
#&gt; warning and incorrect counts. There are two
#&gt; disadvantages to using this switch: 1/code count
#&gt; performance drops, and 2/code generated with
#&gt; --strip-comments will contain different strings
#&gt; where ever embedded comments are found.
#&gt; --sum-reports Input arguments are report files previously
#&gt; created with the --report-file option. Makes
#&gt; a cumulative set of results containing the
#&gt; sum of data from the individual report files.
#&gt; --processes=NUM [Available only on systems with a recent version
#&gt; of the Parallel::ForkManager module. Not
#&gt; available on Windows.] Sets the maximum number of
#&gt; cores that cloc uses. The default value of 0
#&gt; disables multiprocessing.
#&gt; --unix Override the operating system autodetection
#&gt; logic and run in UNIX mode. See also
#&gt; --windows, --show-os.
#&gt; --use-sloccount If SLOCCount is installed, use its compiled
#&gt; executables c_count, java_count, pascal_count,
#&gt; php_count, and xml_count instead of cloc's
#&gt; counters. SLOCCount's compiled counters are
#&gt; substantially faster than cloc's and may give
#&gt; a performance improvement when counting projects
#&gt; with large files. However, these cloc-specific
#&gt; features will not be available: --diff,
#&gt; --count-and-diff, --strip-comments, --unicode.
#&gt; --windows Override the operating system autodetection
#&gt; logic and run in Microsoft Windows mode.
#&gt; See also --unix, --show-os.
#&gt;
#&gt; Filter Options
#&gt; --exclude-dir=&lt;D1&gt;[,D2,] Exclude the given comma separated directories
#&gt; D1, D2, D3, et cetera, from being scanned. For
#&gt; example --exclude-dir=.cache,test will skip
#&gt; all files and subdirectories that have /.cache/
#&gt; or /test/ as their parent directory.
#&gt; Directories named .bzr, .cvs, .hg, .git, .svn,
#&gt; and .snapshot are always excluded.
#&gt; This option only works with individual directory
#&gt; names so including file path separators is not
#&gt; allowed. Use --fullpath and --not-match-d=&lt;regex&gt;
#&gt; to supply a regex matching multiple subdirectories.
#&gt; --exclude-ext=&lt;ext1&gt;[,&lt;ext2&gt;[...]]
#&gt; Do not count files having the given file name
#&gt; extensions.
#&gt; --exclude-lang=&lt;L1&gt;[,L2[...]]
#&gt; Exclude the given comma separated languages
#&gt; L1, L2, L3, et cetera, from being counted.
#&gt; --exclude-list-file=&lt;file&gt; Ignore files and/or directories whose names
#&gt; appear in &lt;file&gt;. &lt;file&gt; should have one file
#&gt; name per line. Only exact matches are ignored;
#&gt; relative path names will be resolved starting from
#&gt; the directory where cloc is invoked.
#&gt; See also --list-file.
#&gt; --fullpath Modifies the behavior of --match-f, --not-match-f,
#&gt; and --not-match-d to include the file's path
#&gt; in the regex, not just the file's basename.
#&gt; (This does not expand each file to include its
#&gt; absolute path, instead it uses as much of
#&gt; the path as is passed in to cloc.)
#&gt; Note: --match-d always looks at the full
#&gt; path and therefore is unaffected by --fullpath.
#&gt; --include-ext=&lt;ext1&gt;[,ext2[...]]
#&gt; Count only languages having the given comma
#&gt; separated file extensions. Use --show-ext to
#&gt; see the recognized extensions.
#&gt; --include-lang=&lt;L1&gt;[,L2[...]]
#&gt; Count only the given comma separated languages
#&gt; L1, L2, L3, et cetera. Use --show-lang to see
#&gt; the list of recognized languages.
#&gt; --match-d=&lt;regex&gt; Only count files in directories matching the Perl
#&gt; regex. For example
#&gt; --match-d='/(src|include)/'
#&gt; only counts files in directories containing
#&gt; /src/ or /include/. Unlike --not-match-d,
#&gt; --match-f, and --not-match-f, --match-d always
#&gt; compares the fully qualified path against the
#&gt; regex.
#&gt; --not-match-d=&lt;regex&gt; Count all files except those in directories
#&gt; matching the Perl regex. Only the trailing
#&gt; directory name is compared, for example, when
#&gt; counting in /usr/local/lib, only 'lib' is
#&gt; compared to the regex.
#&gt; Add --fullpath to compare parent directories to
#&gt; the regex.
#&gt; Do not include file path separators at the
#&gt; beginning or end of the regex.
#&gt; --match-f=&lt;regex&gt; Only count files whose basenames match the Perl
#&gt; regex. For example
#&gt; --match-f='^[Ww]idget'
#&gt; only counts files that start with Widget or widget.
#&gt; Add --fullpath to include parent directories
#&gt; in the regex instead of just the basename.
#&gt; --not-match-f=&lt;regex&gt; Count all files except those whose basenames
#&gt; match the Perl regex. Add --fullpath to include
#&gt; parent directories in the regex instead of just
#&gt; the basename.
#&gt; --skip-archive=&lt;regex&gt; Ignore files that end with the given Perl regular
#&gt; expression. For example, if given
#&gt; --skip-archive='(zip|tar(.(gz|Z|bz2|xz|7z))?)'
#&gt; the code will skip files that end with .zip,
#&gt; .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and
#&gt; .tar.7z.
#&gt; --skip-win-hidden On Windows, ignore hidden files.
#&gt;
#&gt; Debug Options
#&gt; --categorized=&lt;file&gt; Save names of categorized files to &lt;file&gt;.
#&gt; --counted=&lt;file&gt; Save names of processed source files to &lt;file&gt;.
#&gt; --diff-alignment=&lt;file&gt; Write to &lt;file&gt; a list of files and file pairs
#&gt; showing which files were added, removed, and/or
#&gt; compared during a run with --diff. This switch
#&gt; forces the --diff mode on.
#&gt; --explain=&lt;lang&gt; Print the filters used to remove comments for
#&gt; language &lt;lang&gt; and exit. In some cases the
#&gt; filters refer to Perl subroutines rather than
#&gt; regular expressions. An examination of the
#&gt; source code may be needed for further explanation.
#&gt; --help Print this usage information and exit.
#&gt; --found=&lt;file&gt; Save names of every file found to &lt;file&gt;.
#&gt; --ignored=&lt;file&gt; Save names of ignored files and the reason they
#&gt; were ignored to &lt;file&gt;.
#&gt; --print-filter-stages Print processed source code before and after
#&gt; each filter is applied.
#&gt; --show-ext[=&lt;ext&gt;] Print information about all known (or just the
#&gt; given) file extensions and exit.
#&gt; --show-lang[=&lt;lang&gt;] Print information about all known (or just the
#&gt; given) languages and exit.
#&gt; --show-os Print the value of the operating system mode
#&gt; and exit. See also --unix, --windows.
#&gt; -v[=&lt;n&gt;] Verbose switch (optional numeric value).
#&gt; -verbose[=&lt;n&gt;] Long form of -v.
#&gt; --version Print the version of this program and exit.
#&gt; --write-lang-def=&lt;file&gt; Writes to &lt;file&gt; the language processing filters
#&gt; then exits. Useful as a first step to creating
#&gt; custom language definitions. Note: languages which
#&gt; map to the same file extension will be excluded.
#&gt; (See also --force-lang-def, --read-lang-def).
#&gt; --write-lang-def-incl-dup=&lt;file&gt;
#&gt; Same as --write-lang-def, but includes duplicated
#&gt; extensions. This generates a problematic language
#&gt; definition file because cloc will refuse to use
#&gt; it until duplicates are removed.
#&gt;
#&gt; Output Options
#&gt; --3 Print third-generation language output.
#&gt; (This option can cause report summation to fail
#&gt; if some reports were produced with this option
#&gt; while others were produced without it.)
#&gt; --by-percent X Instead of comment and blank line counts, show
#&gt; these values as percentages based on the value
#&gt; of X in the denominator:
#&gt; X = 'c' -&gt; # lines of code
#&gt; X = 'cm' -&gt; # lines of code + comments
#&gt; X = 'cb' -&gt; # lines of code + blanks
#&gt; X = 'cmb' -&gt; # lines of code + comments + blanks
#&gt; For example, if using method 'c' and your code
#&gt; has twice as many lines of comments as lines
#&gt; of code, the value in the comment column will
#&gt; be 200%. The code column remains a line count.
#&gt; --csv Write the results as comma separated values.
#&gt; --csv-delimiter=&lt;C&gt; Use the character &lt;C&gt; as the delimiter for comma
#&gt; separated files instead of ,. This switch forces
#&gt; --file-encoding=&lt;E&gt; Write output files using the &lt;E&gt; encoding instead of
#&gt; the default ASCII (&lt;E&gt; = 'UTF-7'). Examples: 'UTF-16',
#&gt; 'euc-kr', 'iso-8859-16'. Known encodings can be
#&gt; printed with
#&gt; perl -MEncode -e 'print join("\n", Encode-&gt;encodings(":all")), "\n"'
#&gt; --hide-rate Do not show line and file processing rates in the
#&gt; output header. This makes output deterministic.
#&gt; --json Write the results as JavaScript Object Notation
#&gt; (JSON) formatted output.
#&gt; --md Write the results as Markdown-formatted text.
#&gt; --out=&lt;file&gt; Synonym for --report-file=&lt;file&gt;.
#&gt; --progress-rate=&lt;n&gt; Show progress update after every &lt;n&gt; files are
#&gt; processed (default &lt;n&gt;=100). Set &lt;n&gt; to 0 to
#&gt; suppress progress output (useful when redirecting
#&gt; output to STDOUT).
#&gt; --quiet Suppress all information messages except for
#&gt; the final report.
#&gt; --report-file=&lt;file&gt; Write the results to &lt;file&gt; instead of STDOUT.
#&gt; --sql=&lt;file&gt; Write results as SQL create and insert statements
#&gt; which can be read by a database program such as
#&gt; SQLite. If &lt;file&gt; is -, output is sent to STDOUT.
#&gt; --sql-append Append SQL insert statements to the file specified
#&gt; by --sql and do not generate table creation
#&gt; statements. Only valid with the --sql option.
#&gt; --sql-project=&lt;name&gt; Use &lt;name&gt; as the project identifier for the
#&gt; current run. Only valid with the --sql option.
#&gt; --sql-style=&lt;style&gt; Write SQL statements in the given style instead
#&gt; of the default SQLite format. Styles include
#&gt; 'Oracle' and 'Named_Columns'.
#&gt; --sum-one For plain text reports, show the SUM: output line
#&gt; even if only one input file is processed.
#&gt; --xml Write the results in XML.
#&gt; --xsl=&lt;file&gt; Reference &lt;file&gt; as an XSL stylesheet within
#&gt; the XML output. If &lt;file&gt; is 1 (numeric one),
#&gt; writes a default stylesheet, cloc.xsl (or
#&gt; cloc-diff.xsl if --diff is also given).
#&gt; This switch forces --xml on.
#&gt; --yaml Write the results in YAML.
#&gt; </div><div class='input'>
<span class='co'># or use the helper version of the above</span>
<span class='fu'>cloc_help</span>()</div><div class='output co'>#&gt;
#&gt; Usage: cloc.pl [options] &lt;file(s)/dir(s)/git hash(es)&gt; | &lt;set 1&gt; &lt;set 2&gt; | &lt;report files&gt;
#&gt;
#&gt; Count, or compute differences of, physical lines of source code in the
#&gt; given files (may be archives such as compressed tarballs or zip files,
#&gt; or git commit hashes or branch names) and/or recursively below the
#&gt; given directories.
#&gt;
#&gt; Input Options
#&gt; --extract-with=&lt;cmd&gt; This option is only needed if cloc is unable
#&gt; to figure out how to extract the contents of
#&gt; the input file(s) by itself.
#&gt; Use &lt;cmd&gt; to extract binary archive files (e.g.:
#&gt; .tar.gz, .zip, .Z). Use the literal '&gt;FILE&lt;' as
#&gt; a stand-in for the actual file(s) to be
#&gt; extracted. For example, to count lines of code
#&gt; in the input files
#&gt; gcc-4.2.tar.gz perl-5.8.8.tar.gz
#&gt; on Unix use
#&gt; --extract-with='gzip -dc &gt;FILE&lt; | tar xf -'
#&gt; or, if you have GNU tar,
#&gt; --extract-with='tar zxf &gt;FILE&lt;'
#&gt; and on Windows use, for example:
#&gt; --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o &gt;FILE&lt; ."
#&gt; (if WinZip is installed there).
#&gt; --list-file=&lt;file&gt; Take the list of file and/or directory names to
#&gt; process from &lt;file&gt;, which has one file/directory
#&gt; name per line. Only exact matches are counted;
#&gt; relative path names will be resolved starting from
#&gt; the directory where cloc is invoked.
#&gt; See also --exclude-list-file.
#&gt; --vcs=&lt;VCS&gt; Invoke a system call to &lt;VCS&gt; to obtain a list of
#&gt; files to work on. If &lt;VCS&gt; is 'git', then will
#&gt; invoke 'git ls-files' to get a file list and
#&gt; 'git submodule status' to get a list of submodules
#&gt; whose contents will be ignored. See also --git
#&gt; which accepts git commit hashes and branch names.
#&gt; If &lt;VCS&gt; is 'svn' then will invoke 'svn list -R'.
#&gt; The primary benefit is that cloc will then skip
#&gt; files explicitly excluded by the versioning tool
#&gt; in question, ie, those in .gitignore or have the
#&gt; svn:ignore property.
#&gt; Alternatively &lt;VCS&gt; may be any system command
#&gt; that generates a list of files.
#&gt; Note: cloc must be in a directory which can read
#&gt; the files as they are returned by &lt;VCS&gt;. cloc will
#&gt; not download files from remote repositories.
#&gt; 'svn list -R' may refer to a remote repository
#&gt; to obtain file names (and therefore may require
#&gt; authentication to the remote repository), but
#&gt; the files themselves must be local.
#&gt; --unicode Check binary files to see if they contain Unicode
#&gt; expanded ASCII text. This causes performance to
#&gt; drop noticeably.
#&gt;
#&gt; Processing Options
#&gt; --autoconf Count .in files (as processed by GNU autoconf) of
#&gt; recognized languages. See also --no-autogen.
#&gt; --by-file Report results for every source file encountered.
#&gt; --by-file-by-lang Report results for every source file encountered
#&gt; in addition to reporting by language.
#&gt; --config &lt;file&gt; Read command line switches from &lt;file&gt; instead of
#&gt; the default location of /Users/bob/.config/cloc/options.txt.
#&gt; The file should contain one switch, along with
#&gt; arguments (if any), per line. Blank lines and lines
#&gt; beginning with '#' are skipped. Options given on
#&gt; the command line take priority over entries read from
#&gt; the file.
#&gt; --count-and-diff &lt;set1&gt; &lt;set2&gt;
#&gt; First perform direct code counts of source file(s)
#&gt; of &lt;set1&gt; and &lt;set2&gt; separately, then perform a diff
#&gt; of these. Inputs may be pairs of files, directories,
#&gt; or archives. If --out or --report-file is given,
#&gt; three output files will be created, one for each
#&gt; of the two counts and one for the diff. See also
#&gt; --diff, --diff-alignment, --diff-timeout,
#&gt; --ignore-case, --ignore-whitespace.
#&gt; --diff &lt;set1&gt; &lt;set2&gt; Compute differences in code and comments between
#&gt; source file(s) of &lt;set1&gt; and &lt;set2&gt;. The inputs
#&gt; may be any mix of files, directories, archives,
#&gt; or git commit hashes. Use --diff-alignment to
#&gt; generate a list showing which file pairs where
#&gt; compared. See also --count-and-diff, --diff-alignment,
#&gt; --diff-timeout, --ignore-case, --ignore-whitespace.
#&gt; --diff-timeout &lt;N&gt; Ignore files which take more than &lt;N&gt; seconds
#&gt; to process. Default is 10 seconds. Setting &lt;N&gt;
#&gt; to 0 allows unlimited time. (Large files with many
#&gt; repeated lines can cause Algorithm::Diff::sdiff()
#&gt; to take hours.)
#&gt; --follow-links [Unix only] Follow symbolic links to directories
#&gt; (sym links to files are always followed).
#&gt; --force-lang=&lt;lang&gt;[,&lt;ext&gt;]
#&gt; Process all files that have a &lt;ext&gt; extension
#&gt; with the counter for language &lt;lang&gt;. For
#&gt; example, to count all .f files with the
#&gt; Fortran 90 counter (which expects files to
#&gt; end with .f90) instead of the default Fortran 77
#&gt; counter, use
#&gt; --force-lang="Fortran 90",f
#&gt; If &lt;ext&gt; is omitted, every file will be counted
#&gt; with the &lt;lang&gt; counter. This option can be
#&gt; specified multiple times (but that is only
#&gt; useful when &lt;ext&gt; is given each time).
#&gt; See also --script-lang, --lang-no-ext.
#&gt; --force-lang-def=&lt;file&gt; Load language processing filters from &lt;file&gt;,
#&gt; then use these filters instead of the built-in
#&gt; filters. Note: languages which map to the same
#&gt; file extension (for example:
#&gt; MATLAB/Mathematica/Objective C/MUMPS/Mercury;
#&gt; Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog)
#&gt; will be ignored as these require additional
#&gt; processing that is not expressed in language
#&gt; definition files. Use --read-lang-def to define
#&gt; new language filters without replacing built-in
#&gt; filters (see also --write-lang-def,
#&gt; --write-lang-def-incl-dup).
#&gt; --git Forces the inputs to be interpreted as git targets
#&gt; (commit hashes, branch names, et cetera) if these
#&gt; are not first identified as file or directory
#&gt; names. This option overrides the --vcs=git logic
#&gt; if this is given; in other words, --git gets its
#&gt; list of files to work on directly from git using
#&gt; the hash or branch name rather than from
#&gt; 'git ls-files'. This option can be used with
#&gt; --diff to perform line count diffs between git
#&gt; commits, or between a git commit and a file,
#&gt; directory, or archive. Use -v/--verbose to see
#&gt; the git system commands cloc issues.
#&gt; --ignore-whitespace Ignore horizontal white space when comparing files
#&gt; with --diff. See also --ignore-case.
#&gt; --ignore-case Ignore changes in case; consider upper- and lower-
#&gt; case letters equivalent when comparing files with
#&gt; --diff. See also --ignore-whitespace.
#&gt; --lang-no-ext=&lt;lang&gt; Count files without extensions using the &lt;lang&gt;
#&gt; counter. This option overrides internal logic
#&gt; for files without extensions (where such files
#&gt; are checked against known scripting languages
#&gt; by examining the first line for #!). See also
#&gt; --force-lang, --script-lang.
#&gt; --max-file-size=&lt;MB&gt; Skip files larger than &lt;MB&gt; megabytes when
#&gt; traversing directories. By default, &lt;MB&gt;=100.
#&gt; cloc's memory requirement is roughly twenty times
#&gt; larger than the largest file so running with
#&gt; files larger than 100 MB on a computer with less
#&gt; than 2 GB of memory will cause problems.
#&gt; Note: this check does not apply to files
#&gt; explicitly passed as command line arguments.
#&gt; --no-autogen[=list] Ignore files generated by code-production systems
#&gt; such as GNU autoconf. To see a list of these files
#&gt; (then exit), run with --no-autogen list
#&gt; See also --autoconf.
#&gt; --original-dir [Only effective in combination with
#&gt; --strip-comments] Write the stripped files
#&gt; to the same directory as the original files.
#&gt; --read-binary-files Process binary files in addition to text files.
#&gt; This is usually a bad idea and should only be
#&gt; attempted with text files that have embedded
#&gt; binary data.
#&gt; --read-lang-def=&lt;file&gt; Load new language processing filters from &lt;file&gt;
#&gt; and merge them with those already known to cloc.
#&gt; If &lt;file&gt; defines a language cloc already knows
#&gt; about, cloc's definition will take precedence.
#&gt; Use --force-lang-def to over-ride cloc's
#&gt; definitions (see also --write-lang-def,
#&gt; --write-lang-def-incl-dup).
#&gt; --script-lang=&lt;lang&gt;,&lt;s&gt; Process all files that invoke &lt;s&gt; as a #!
#&gt; scripting language with the counter for language
#&gt; &lt;lang&gt;. For example, files that begin with
#&gt; #!/usr/local/bin/perl5.8.8
#&gt; will be counted with the Perl counter by using
#&gt; --script-lang=Perl,perl5.8.8
#&gt; The language name is case insensitive but the
#&gt; name of the script language executable, &lt;s&gt;,
#&gt; must have the right case. This option can be
#&gt; specified multiple times. See also --force-lang,
#&gt; --lang-no-ext.
#&gt; --sdir=&lt;dir&gt; Use &lt;dir&gt; as the scratch directory instead of
#&gt; letting File::Temp chose the location. Files
#&gt; written to this location are not removed at
#&gt; the end of the run (as they are with File::Temp).
#&gt; --skip-uniqueness Skip the file uniqueness check. This will give
#&gt; a performance boost at the expense of counting
#&gt; files with identical contents multiple times
#&gt; (if such duplicates exist).
#&gt; --stdin-name=&lt;file&gt; Give a file name to use to determine the language
#&gt; for standard input. (Use - as the input name to
#&gt; receive source code via STDIN.)
#&gt; --strip-comments=&lt;ext&gt; For each file processed, write to the current
#&gt; directory a version of the file which has blank
#&gt; and commented lines removed (in-line comments
#&gt; persist). The name of each stripped file is the
#&gt; original file name with .&lt;ext&gt; appended to it.
#&gt; It is written to the current directory unless
#&gt; --original-dir is on.
#&gt; --strip-str-comments Replace comment markers embedded in strings with
#&gt; 'xx'. This attempts to work around a limitation
#&gt; in Regexp::Common::Comment where comment markers
#&gt; embedded in strings are seen as actual comment
#&gt; markers and not strings, often resulting in a
#&gt; 'Complex regular subexpression recursion limit'
#&gt; warning and incorrect counts. There are two
#&gt; disadvantages to using this switch: 1/code count
#&gt; performance drops, and 2/code generated with
#&gt; --strip-comments will contain different strings
#&gt; where ever embedded comments are found.
#&gt; --sum-reports Input arguments are report files previously
#&gt; created with the --report-file option. Makes
#&gt; a cumulative set of results containing the
#&gt; sum of data from the individual report files.
#&gt; --processes=NUM [Available only on systems with a recent version
#&gt; of the Parallel::ForkManager module. Not
#&gt; available on Windows.] Sets the maximum number of
#&gt; cores that cloc uses. The default value of 0
#&gt; disables multiprocessing.
#&gt; --unix Override the operating system autodetection
#&gt; logic and run in UNIX mode. See also
#&gt; --windows, --show-os.
#&gt; --use-sloccount If SLOCCount is installed, use its compiled
#&gt; executables c_count, java_count, pascal_count,
#&gt; php_count, and xml_count instead of cloc's
#&gt; counters. SLOCCount's compiled counters are
#&gt; substantially faster than cloc's and may give
#&gt; a performance improvement when counting projects
#&gt; with large files. However, these cloc-specific
#&gt; features will not be available: --diff,
#&gt; --count-and-diff, --strip-comments, --unicode.
#&gt; --windows Override the operating system autodetection
#&gt; logic and run in Microsoft Windows mode.
#&gt; See also --unix, --show-os.
#&gt;
#&gt; Filter Options
#&gt; --exclude-dir=&lt;D1&gt;[,D2,] Exclude the given comma separated directories
#&gt; D1, D2, D3, et cetera, from being scanned. For
#&gt; example --exclude-dir=.cache,test will skip
#&gt; all files and subdirectories that have /.cache/
#&gt; or /test/ as their parent directory.
#&gt; Directories named .bzr, .cvs, .hg, .git, .svn,
#&gt; and .snapshot are always excluded.
#&gt; This option only works with individual directory
#&gt; names so including file path separators is not
#&gt; allowed. Use --fullpath and --not-match-d=&lt;regex&gt;
#&gt; to supply a regex matching multiple subdirectories.
#&gt; --exclude-ext=&lt;ext1&gt;[,&lt;ext2&gt;[...]]
#&gt; Do not count files having the given file name
#&gt; extensions.
#&gt; --exclude-lang=&lt;L1&gt;[,L2[...]]
#&gt; Exclude the given comma separated languages
#&gt; L1, L2, L3, et cetera, from being counted.
#&gt; --exclude-list-file=&lt;file&gt; Ignore files and/or directories whose names
#&gt; appear in &lt;file&gt;. &lt;file&gt; should have one file
#&gt; name per line. Only exact matches are ignored;
#&gt; relative path names will be resolved starting from
#&gt; the directory where cloc is invoked.
#&gt; See also --list-file.
#&gt; --fullpath Modifies the behavior of --match-f, --not-match-f,
#&gt; and --not-match-d to include the file's path
#&gt; in the regex, not just the file's basename.
#&gt; (This does not expand each file to include its
#&gt; absolute path, instead it uses as much of
#&gt; the path as is passed in to cloc.)
#&gt; Note: --match-d always looks at the full
#&gt; path and therefore is unaffected by --fullpath.
#&gt; --include-ext=&lt;ext1&gt;[,ext2[...]]
#&gt; Count only languages having the given comma
#&gt; separated file extensions. Use --show-ext to
#&gt; see the recognized extensions.
#&gt; --include-lang=&lt;L1&gt;[,L2[...]]
#&gt; Count only the given comma separated languages
#&gt; L1, L2, L3, et cetera. Use --show-lang to see
#&gt; the list of recognized languages.
#&gt; --match-d=&lt;regex&gt; Only count files in directories matching the Perl
#&gt; regex. For example
#&gt; --match-d='/(src|include)/'
#&gt; only counts files in directories containing
#&gt; /src/ or /include/. Unlike --not-match-d,
#&gt; --match-f, and --not-match-f, --match-d always
#&gt; compares the fully qualified path against the
#&gt; regex.
#&gt; --not-match-d=&lt;regex&gt; Count all files except those in directories
#&gt; matching the Perl regex. Only the trailing
#&gt; directory name is compared, for example, when
#&gt; counting in /usr/local/lib, only 'lib' is
#&gt; compared to the regex.
#&gt; Add --fullpath to compare parent directories to
#&gt; the regex.
#&gt; Do not include file path separators at the
#&gt; beginning or end of the regex.
#&gt; --match-f=&lt;regex&gt; Only count files whose basenames match the Perl
#&gt; regex. For example
#&gt; --match-f='^[Ww]idget'
#&gt; only counts files that start with Widget or widget.
#&gt; Add --fullpath to include parent directories
#&gt; in the regex instead of just the basename.
#&gt; --not-match-f=&lt;regex&gt; Count all files except those whose basenames
#&gt; match the Perl regex. Add --fullpath to include
#&gt; parent directories in the regex instead of just
#&gt; the basename.
#&gt; --skip-archive=&lt;regex&gt; Ignore files that end with the given Perl regular
#&gt; expression. For example, if given
#&gt; --skip-archive='(zip|tar(.(gz|Z|bz2|xz|7z))?)'
#&gt; the code will skip files that end with .zip,
#&gt; .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and
#&gt; .tar.7z.
#&gt; --skip-win-hidden On Windows, ignore hidden files.
#&gt;
#&gt; Debug Options
#&gt; --categorized=&lt;file&gt; Save names of categorized files to &lt;file&gt;.
#&gt; --counted=&lt;file&gt; Save names of processed source files to &lt;file&gt;.
#&gt; --diff-alignment=&lt;file&gt; Write to &lt;file&gt; a list of files and file pairs
#&gt; showing which files were added, removed, and/or
#&gt; compared during a run with --diff. This switch
#&gt; forces the --diff mode on.
#&gt; --explain=&lt;lang&gt; Print the filters used to remove comments for
#&gt; language &lt;lang&gt; and exit. In some cases the
#&gt; filters refer to Perl subroutines rather than
#&gt; regular expressions. An examination of the
#&gt; source code may be needed for further explanation.
#&gt; --help Print this usage information and exit.
#&gt; --found=&lt;file&gt; Save names of every file found to &lt;file&gt;.
#&gt; --ignored=&lt;file&gt; Save names of ignored files and the reason they
#&gt; were ignored to &lt;file&gt;.
#&gt; --print-filter-stages Print processed source code before and after
#&gt; each filter is applied.
#&gt; --show-ext[=&lt;ext&gt;] Print information about all known (or just the
#&gt; given) file extensions and exit.
#&gt; --show-lang[=&lt;lang&gt;] Print information about all known (or just the
#&gt; given) languages and exit.
#&gt; --show-os Print the value of the operating system mode
#&gt; and exit. See also --unix, --windows.
#&gt; -v[=&lt;n&gt;] Verbose switch (optional numeric value).
#&gt; -verbose[=&lt;n&gt;] Long form of -v.
#&gt; --version Print the version of this program and exit.
#&gt; --write-lang-def=&lt;file&gt; Writes to &lt;file&gt; the language processing filters
#&gt; then exits. Useful as a first step to creating
#&gt; custom language definitions. Note: languages which
#&gt; map to the same file extension will be excluded.
#&gt; (See also --force-lang-def, --read-lang-def).
#&gt; --write-lang-def-incl-dup=&lt;file&gt;
#&gt; Same as --write-lang-def, but includes duplicated
#&gt; extensions. This generates a problematic language
#&gt; definition file because cloc will refuse to use
#&gt; it until duplicates are removed.
#&gt;
#&gt; Output Options
#&gt; --3 Print third-generation language output.
#&gt; (This option can cause report summation to fail
#&gt; if some reports were produced with this option
#&gt; while others were produced without it.)
#&gt; --by-percent X Instead of comment and blank line counts, show
#&gt; these values as percentages based on the value
#&gt; of X in the denominator:
#&gt; X = 'c' -&gt; # lines of code
#&gt; X = 'cm' -&gt; # lines of code + comments
#&gt; X = 'cb' -&gt; # lines of code + blanks
#&gt; X = 'cmb' -&gt; # lines of code + comments + blanks
#&gt; For example, if using method 'c' and your code
#&gt; has twice as many lines of comments as lines
#&gt; of code, the value in the comment column will
#&gt; be 200%. The code column remains a line count.
#&gt; --csv Write the results as comma separated values.
#&gt; --csv-delimiter=&lt;C&gt; Use the character &lt;C&gt; as the delimiter for comma
#&gt; separated files instead of ,. This switch forces
#&gt; --file-encoding=&lt;E&gt; Write output files using the &lt;E&gt; encoding instead of
#&gt; the default ASCII (&lt;E&gt; = 'UTF-7'). Examples: 'UTF-16',
#&gt; 'euc-kr', 'iso-8859-16'. Known encodings can be
#&gt; printed with
#&gt; perl -MEncode -e 'print join("\n", Encode-&gt;encodings(":all")), "\n"'
#&gt; --hide-rate Do not show line and file processing rates in the
#&gt; output header. This makes output deterministic.
#&gt; --json Write the results as JavaScript Object Notation
#&gt; (JSON) formatted output.
#&gt; --md Write the results as Markdown-formatted text.
#&gt; --out=&lt;file&gt; Synonym for --report-file=&lt;file&gt;.
#&gt; --progress-rate=&lt;n&gt; Show progress update after every &lt;n&gt; files are
#&gt; processed (default &lt;n&gt;=100). Set &lt;n&gt; to 0 to
#&gt; suppress progress output (useful when redirecting
#&gt; output to STDOUT).
#&gt; --quiet Suppress all information messages except for
#&gt; the final report.
#&gt; --report-file=&lt;file&gt; Write the results to &lt;file&gt; instead of STDOUT.
#&gt; --sql=&lt;file&gt; Write results as SQL create and insert statements
#&gt; which can be read by a database program such as
#&gt; SQLite. If &lt;file&gt; is -, output is sent to STDOUT.
#&gt; --sql-append Append SQL insert statements to the file specified
#&gt; by --sql and do not generate table creation
#&gt; statements. Only valid with the --sql option.
#&gt; --sql-project=&lt;name&gt; Use &lt;name&gt; as the project identifier for the
#&gt; current run. Only valid with the --sql option.
#&gt; --sql-style=&lt;style&gt; Write SQL statements in the given style instead
#&gt; of the default SQLite format. Styles include
#&gt; 'Oracle' and 'Named_Columns'.
#&gt; --sum-one For plain text reports, show the SUM: output line
#&gt; even if only one input file is processed.
#&gt; --xml Write the results in XML.
#&gt; --xsl=&lt;file&gt; Reference &lt;file&gt; as an XSL stylesheet within
#&gt; the XML output. If &lt;file&gt; is 1 (numeric one),
#&gt; writes a default stylesheet, cloc.xsl (or
#&gt; cloc-diff.xsl if --diff is also given).
#&gt; This switch forces --xml on.
#&gt; --yaml Write the results in YAML.
#&gt; </div><div class='input'>
<span class='co'># show the OS type</span>
<span class='fu'>cloc_call</span>(<span class='st'>"--show-os"</span>)</div><div class='output co'>#&gt; UNIX</div><div class='input'>
<span class='co'># shortcut equivalent</span>
<span class='fu'>cloc_os</span>()</div><div class='output co'>#&gt; [1] "UNIX"</div><div class='input'>
<span class='co'># retrieve the OS type</span>
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/trimws'>trimws</a></span>(<span class='fu'>cloc_call</span>(<span class='st'>"--show-os"</span>)$<span class='no'>stdout</span>)</div><div class='output co'>#&gt; UNIX</div><div class='output co'>#&gt; [1] "UNIX"</div><div class='input'>
<span class='co'># shortcut of the above with no echo and only returning trimmed stdout</span>
<span class='fu'>cloc_os</span>()</div><div class='output co'>#&gt; [1] "UNIX"</div><div class='input'>
<span class='co'># get version of cloc.pl script provided with the package</span>
<span class='fu'>cloc_version</span>()</div><div class='output co'>#&gt; [1] "1.80"</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#arguments">Arguments</a></li>
<li><a href="#value">Value</a></li>
<li><a href="#caveat-utilitor">Caveat utilitor</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis, Al Danial.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>