.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "cloc 1" .TH cloc 1 "2019-02-25" "cloc" "User Commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" cloc \- Count, or compute differences of, lines of source code and comments. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& cloc [options] ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Count, or compute differences of, physical lines of source code in the given files (may be archives such as compressed tarballs or zip files, or git commit hashes or branch names) and/or recursively below the given directories. It is written entirely in Perl, using only modules from the standard distribution. .SH "OPTIONS" .IX Header "OPTIONS" .SS "Input Options" .IX Subsection "Input Options" To count standard input, use the special filename \fB\-\fR and either \&\fB\-\-stdin\-name=FILE\fR to tell cloc the name of the file being piped in, or \fB\-\-force\-lang=LANG\fR to apply the \s-1LANG\s0 counter to all input. .IP "\fB\-\-extract\-with=CMD\fR" 4 .IX Item "--extract-with=CMD" This option is only needed if cloc is unable to figure out how to extract the contents of the input file(s) by itself. Use \s-1CMD\s0 to extract binary archive files (e.g.: .tar.gz, .zip, .Z). Use the literal '>FILE<' as a stand-in for the actual file(s) to be extracted. For example, to count lines of code in the input files gcc\-4.2.tar.gz perl\-5.8.8.tar.gz on Unix use: .Sp .Vb 1 \& \-\-extract\-with=\*(Aqgzip \-dc >FILE< | tar xf \- .Ve .Sp or, if you have \s-1GNU\s0 tar: .Sp .Vb 1 \& \-\-extract\-with=\*(Aqtar zxf >FILE<\*(Aq .Ve .Sp and on Windows, use, for example: .Sp .Vb 1 \& \-\-extract\-with="\e"c:\eProgram Files\eWinZip\eWinZip32.exe\e" \-e \-o >FILE< .Ve .IP "\fB\-\-list\-file=FILE\fR" 4 .IX Item "--list-file=FILE" Take the list of file and/or directory names to process from \s-1FILE,\s0 which has one file/directory name per line. Only exact matches are counted; relative path names will be resolved starting from the directory where cloc is invoked. See also \&\fB\-\-exclude\-list\-file\fR. .IP "\fB\-\-vcs=VCS\fR" 4 .IX Item "--vcs=VCS" Invoke a system call to \s-1VCS\s0 to obtain a list of files to work on. If \s-1VCS\s0 is 'git', then will invoke 'git ls\-files' to get a file list and \&'git submodule status' to get a list of submodules whose contents will be ignored. See also \-\-git which accepts git commit hashes and branch names. If \s-1VCS\s0 is 'svn' then will invoke 'svn list \-R'. The primary benefit is that cloc will then skip files explicitly excluded by the versioning tool in question, ie, those in .gitignore or have the svn:ignore property. Alternatively \s-1VCS\s0 may be any system command that generates a list of files. Note: cloc must be in a directory which can read the files as they are returned by \s-1VCS.\s0 cloc will not download files from remote repositories. \&'svn list \-R' may refer to a remote repository to obtain file names (and therefore may require authentication to the remote repository), but the files themselves must be local. .IP "\fB\-\-unicode\fR" 4 .IX Item "--unicode" Check binary files to see if they contain Unicode expanded \s-1ASCII\s0 text. This causes performance to drop noticeably. .SS "Processing Options" .IX Subsection "Processing Options" .IP "\fB\-\-autoconf\fR" 4 .IX Item "--autoconf" Count .in files (as processed by \s-1GNU\s0 autoconf) of recognized languages. See also \fB\-\-no\-autogen\fR. .IP "\fB\-\-by\-file\fR" 4 .IX Item "--by-file" Report results for every source file encountered. .IP "\fB\-\-by\-file\-by\-lang\fR" 4 .IX Item "--by-file-by-lang" Report results for every source file encountered in addition to reporting by language. .IP "\fB\-\-config \s-1FILE\s0\fR" 4 .IX Item "--config FILE" First perform direct code counts of source file(s) .Sp Read command line switches from \s-1FILE\s0 instead of the default location of ~/.config/cloc/options.txt. The file should contain one switch, along with arguments (if any), per line. Blank lines and lines beginning with '#' are skipped. Options given on the command line take priority over entries read from the file. .IP "\fB\-\-count\-and\-diff \s-1SET1 SET2\s0\fR" 4 .IX Item "--count-and-diff SET1 SET2" First perform direct code counts of source file(s) of \s-1SET1\s0 and \s-1SET2\s0 separately, then perform a diff of these. Inputs may be pairs of files, directories, or archives. If \-\-out or \-\-report\-file is given, three output files will be created, one for each of the two counts and one for the diff. See also \fB\-\-diff\fR, \fB\-\-diff\-alignment\fR, \&\fB\-\-diff\-timeout\fR, \fB\-\-ignore\-case\fR, \fB\-\-ignore\-whitespace\fR. .IP "\fB\-\-diff \s-1SET1 SET2\s0\fR" 4 .IX Item "--diff SET1 SET2" Compute differences in code and comments between source file(s) of \&\s-1SET1\s0 and \s-1SET2.\s0 The inputs may be pairs of files, directories, or archives. Use \fB\-\-diff\-alignment\fR to generate a list showing which file pairs where compared. See also \&\fB\-\-count\-and\-diff\fR, \fB\-\-diff\-alignment\fR, \fB\-\-diff\-timeout\fR, \&\fB\-\-ignore\-case\fR, \fB\-\-ignore\-whitespace\fR. .IP "\fB\-\-diff\-timeout N\fR" 4 .IX Item "--diff-timeout N" Ignore files which take more than N seconds to process. Default is 10 seconds. Setting N to 0 allows unlimited time. (Large files with many repeated lines can cause \&\fBAlgorithm::Diff::sdiff()\fR to take hours.) .IP "\fB\-\-follow\-links\fR" 4 .IX Item "--follow-links" [Unix only] Follow symbolic links to directories (sym links to files are always followed). .IP "\fB\-\-force\-lang=LANG[,EXT]\fR" 4 .IX Item "--force-lang=LANG[,EXT]" Process all files that have a \s-1EXT\s0 extension with the counter for language \s-1LANG.\s0 For example, to count all .f files with the Fortran 90 counter (which expects files to end with .f90) instead of the default Fortran 77 counter, use: .Sp .Vb 1 \& \-\-force\-lang="Fortran 90",f .Ve .Sp If \s-1EXT\s0 is omitted, every file will be counted with the \s-1LANG\s0 counter. This option can be specified multiple times (but that is only useful when \s-1EXT\s0 is given each time). See also \fB\-\-script\-lang\fR, \&\fB\-\-lang\-no\-ext\fR. .IP "\fB\-\-force\-lang\-def=FILE\fR" 4 .IX Item "--force-lang-def=FILE" Load language processing filters from \s-1FILE,\s0 then use these filters instead of the built-in filters. Note: languages which map to the same file extension (for example: MATLAB/Objective C/MUMPS; Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog) will be ignored as these require additional processing that is not expressed in language definition files. Use \fB\-\-read\-lang\-def\fR to define new language filters without replacing built-in filters (see also \fB\-\-write\-lang\-def\fR, \fB\-\-write\-lang\-def\-incl\-dup\fR). .IP "\fB\-\-git\fR" 4 .IX Item "--git" Forces the inputs to be interpreted as git targets (commit hashes, branch names, et cetera) if these are not first identified as file or directory names. This option overrides the \-\-vcs=git logic if this is given; in other words, \-\-git gets its list of files to work on directly from git using the hash or branch name rather than from \&'git ls\-files'. This option can be used with \&\-\-diff to perform line count diffs between git commits, or between a git commit and a file, directory, or archive. Use \-v/\-\-verbose to see the git system commands cloc issues. .IP "\fB\-\-ignore\-whitespace\fR" 4 .IX Item "--ignore-whitespace" Ignore horizontal white space when comparing files with \fB\-\-diff\fR. See also \fB\-\-ignore\-case\fR. .IP "\fB\-\-ignore\-case\fR" 4 .IX Item "--ignore-case" Ignore changes in case; consider upper\- and lowercase letters equivalent when comparing files with \fB\-\-diff\fR. See also \fB\-\-ignore\-whitespace\fR. .IP "\fB\-\-lang\-no\-ext=LANG\fR" 4 .IX Item "--lang-no-ext=LANG" Count files without extensions using the \s-1LANG\s0 counter. This option overrides internal logic for files without extensions (where such files are checked against known scripting languages by examining the first line for \f(CW\*(C`#!\*(C'\fR). See also \fB\-\-force\-lang\fR, \fB\-\-script\-lang\fR. .IP "\fB\-\-max\-file\-size=MB\fR" 4 .IX Item "--max-file-size=MB" Skip files larger than \f(CW\*(C`MB\*(C'\fR megabytes when traversing directories. By default, \f(CW\*(C`MB\*(C'\fR=100. cloc's memory requirement is roughly twenty times larger than the largest file so running with files larger than 100 \s-1MB\s0 on a computer with less than 2 \s-1GB\s0 of memory will cause problems. Note: this check does not apply to files explicitly passed as command line arguments. .IP "\fB\-\-no\-autogen[=list]\fR" 4 .IX Item "--no-autogen[=list]" Ignore files generated by code-production systems such as \s-1GNU\s0 autoconf. To see a list of these files (then exit), run with \fB\-\-no\-autogen list\fR See also \fB\-\-autoconf\fR. .IP "\fB\-\-read\-binary\-files\fR" 4 .IX Item "--read-binary-files" Process binary files in addition to text files. This is usually a bad idea and should only be attempted with text files that have embedded binary data. .IP "\fB\-\-read\-lang\-def=FILE\fR" 4 .IX Item "--read-lang-def=FILE" Load new language processing filters from \s-1FILE\s0 and merge them with those already known to cloc. If \s-1FILE\s0 defines a language cloc already knows about, cloc's definition will take precedence. Use \&\fB\-\-force\-lang\-def\fR to over-ride cloc's definitions. (see also \fB\-\-write\-lang\-def\fR). .IP "\fB\-\-script\-lang=LANG,S\fR" 4 .IX Item "--script-lang=LANG,S" Process all files that invoke \f(CW\*(C`S\*(C'\fR as a \f(CW\*(C`#!\*(C'\fR scripting language with the counter for language \s-1LANG.\s0 For example, files that begin with \&\f(CW\*(C`#!/usr/local/bin/perl5.8.8\*(C'\fR will be counted with the Perl counter by using .Sp .Vb 1 \& \-\-script\-lang=Perl,perl5.8.8 .Ve .Sp The language name is case insensitive but the name of the script language executable, \f(CW\*(C`S\*(C'\fR, must have the right case. This option can be specified multiple times. See also \fB\-\-force\-lang\fR. .IP "\fB\-\-sdir=DIR\fR" 4 .IX Item "--sdir=DIR" Use \s-1DIR\s0 as the scratch directory instead of letting \fIFile::Temp\fR chose the location. Files written to this location are not removed at the end of the run (as they are with \fIFile::Temp\fR). .IP "\fB\-\-skip\-uniqueness\fR" 4 .IX Item "--skip-uniqueness" Skip the file uniqueness check. This will give a performance boost at the expense of counting files with identical contents multiple times (if such duplicates exist). .IP "\fB\-\-stdin\-name=FILE\fR" 4 .IX Item "--stdin-name=FILE" Count lines streamed via \fI\s-1STDIN\s0\fR as if they came from a file named \s-1FILE.\s0 .IP "\fB\-\-strip\-comments=EXT\fR" 4 .IX Item "--strip-comments=EXT" For each file processed, write to the current directory a version of the file which has blank and commented lines removed (in-line comments persist). The name of each stripped file is the original file name with \&\f(CW\*(C`.EXT\*(C'\fR appended to it. It is written to the current directory unless \&\fB\-\-original\-dir\fR is on. .IP "\fB\-\-original\-dir\fR" 4 .IX Item "--original-dir" Write the stripped files the same directory as the original files. Only effective in combination with \fB\-\-strip\-comments\fR. .IP "\fB\-\-sum\-reports\fR" 4 .IX Item "--sum-reports" Input arguments are report files previously created with the \&\fB\-\-report\-file\fR option. Makes a cumulative set of results containing the sum of data from the individual report files. .IP "\fB\-\-strip\-str\-comments\fR" 4 .IX Item "--strip-str-comments" Replace comment markers embedded in strings with \&'xx'. This attempts to work around a limitation in Regexp::Common::Comment where comment markers embedded in strings are seen as actual comment markers and not strings, often resulting in a \&'Complex regular subexpression recursion limit' warning and incorrect counts. There are two disadvantages to using this switch: 1/code count performance drops, and 2/code generated with \&\fB\-\-strip\-comments\fR will contain different strings where ever embedded comments are found. .IP "\fB\-\-processes=NUM\fR" 4 .IX Item "--processes=NUM" [Available only on systems with a recent version of the Parallel::ForkManager module. Not available on Windows.] Sets the maximum number of cores that cloc uses. The default value of 0 disables multiprocessing. .IP "\fB\-\-unix\fR" 4 .IX Item "--unix" Over-ride the operating system detection logic and run in \s-1UNIX\s0 mode. See also \fB\-\-windows\fR, \fB\-\-show\-os\fR. .IP "\fB\-\-use\-sloccount\fR" 4 .IX Item "--use-sloccount" If SLOCCount is installed, use its compiled executables c_count, java_count, pascal_count, php_count, and xml_count instead of cloc's counters. SLOCCount's compiled counters are substantially faster than cloc's and may give a performance improvement when counting projects with large files. However, these cloc-specific features will not be available: \fB\-\-diff\fR, \&\fB\-\-count\-and\-diff\fR, \fB\-\-strip\-comments\fR, \fB\-\-unicode\fR. .IP "\fB\-\-windows\fR" 4 .IX Item "--windows" Over-ride the operating system detection logic and run in Microsoft Windows mode. See also \fB\-\-unix\fR, \fB\-\-show\-os\fR. .SS "Filter Options" .IX Subsection "Filter Options" .IP "\fB\-\-exclude\-dir=DIR1[,DIR2 ...]\fR" 4 .IX Item "--exclude-dir=DIR1[,DIR2 ...]" Exclude the given comma separated directories from being scanned. For example: .Sp .Vb 1 \& \-\-exclude\-dir=.cache,test .Ve .Sp will skip all files that match \f(CW\*(C`/.cache/\*(C'\fR or \f(CW\*(C`/test/\*(C'\fR as part of their path. Directories named \f(CW\*(C`.bzr\*(C'\fR, \f(CW\*(C`.cvs\*(C'\fR, \f(CW\*(C`.hg\*(C'\fR, \f(CW\*(C`.git\*(C'\fR, and \f(CW\*(C`.svn\*(C'\fR are always excluded. This option only works with individual directory names so including file path separators is not allowed. Use \fB\-\-fullpath\fR and \fB\-\-not\-match\-d=REGEX\fR to supply a regex matching multiple subdirectories. .IP "\fB\-\-exclude\-ext=EXT1[,EXT2 ...]\fR" 4 .IX Item "--exclude-ext=EXT1[,EXT2 ...]" Do not count files having the given file name extensions. .IP "\fB\-\-exclude\-lang=L1[,L2[...]]\fR" 4 .IX Item "--exclude-lang=L1[,L2[...]]" Exclude the given comma separated languages from being counted. .IP "\fB\-\-exclude\-list\-file=FILE\fR" 4 .IX Item "--exclude-list-file=FILE" Ignore files and/or directories whose names appear in \s-1FILE.\s0 \s-1FILE\s0 should have one file name per line. Only exact matches are ignored; relative path names will be resolved starting from the directory where cloc is invoked. See also \fB\-\-list\-file\fR. .IP "\fB\-\-fullpath\fR" 4 .IX Item "--fullpath" Modifies the behavior of \fB\-\-match\-f\fR or \&\fB\-\-not\-match\-f\fR to include the file's path in the regex, not just the file's basename. (This does not expand each file to include its absolute path, instead it uses as much of the path as is passed in to cloc.) .IP "\fB\-\-include\-ext=" 4 .IX Item "--include-ext=" Count only languages having the given comma separated file extensions. Use \fB\-\-show\-ext\fR to see the recognized extensions. .IP "\fB\-\-include\-lang=L1[,L2 ...]\fR" 4 .IX Item "--include-lang=L1[,L2 ...]" Count only the given comma separated languages L1, L2, L3, et cetera. .IP "\fB\-\-match\-d=REGEX\fR" 4 .IX Item "--match-d=REGEX" Only count files in directories matching the Perl regex. For example .Sp .Vb 1 \& \-\-match\-d=\*(Aq/(src|include)/\*(Aq .Ve .Sp only counts files in directory paths containing \f(CW\*(C`/src/\*(C'\fR or \f(CW\*(C`/include/\*(C'\fR. .IP "\fB\-\-not\-match\-d=REGEX\fR" 4 .IX Item "--not-match-d=REGEX" Count all files except in directories matching the Perl regex. Only the trailing directory name is compared, for example, when counting in \f(CW\*(C`/usr/local/lib\*(C'\fR, only \f(CW\*(C`lib\*(C'\fR is compared to the regex. Add \fB\-\-fullpath\fR to compare parent directories to the regex. Do not include file path separators at the beginning or end of the regex. .IP "\fB\-\-match\-f=REGEX\fR" 4 .IX Item "--match-f=REGEX" Only count files whose basenames match the Perl regex. For example this only counts files at start with Widget or widget: .Sp .Vb 1 \& \-\-match\-f=\*(Aq^[Ww]idget\*(Aq .Ve .Sp Add \fB\-\-fullpath\fR to include parent directories in the regex instead of just the basename. .IP "\fB\-\-not\-match\-f=REGEX\fR" 4 .IX Item "--not-match-f=REGEX" Count all files except those whose basenames match the Perl regex. Add \fB\-\-fullpath\fR to include parent directories in the regex instead of just the basename. .IP "\fB\-\-skip\-archive=REGEX\fR" 4 .IX Item "--skip-archive=REGEX" Ignore files that end with the given Perl regular expression. For example, if given \-\-skip\-archive='(zip|tar(\e.(gz|Z|bz2|xz|7z))?)' the code will skip files that end with .zip, \&.tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and \&.tar.7z. .IP "\fB\-\-skip\-win\-hidden\fR" 4 .IX Item "--skip-win-hidden" On Windows, ignore hidden files. .SS "Debug Options" .IX Subsection "Debug Options" .IP "\fB\-\-categorized=FILE\fR" 4 .IX Item "--categorized=FILE" Save names of categorized files to \s-1FILE.\s0 .IP "\fB\-\-counted=FILE\fR" 4 .IX Item "--counted=FILE" Save names of processed source files to \s-1FILE.\s0 .IP "\fB\-\-diff\-alignment=FILE\fR" 4 .IX Item "--diff-alignment=FILE" Write to \s-1FILE\s0 a list of files and file pairs showing which files were added, removed, and/or compared during a run with \fB\-\-diff\fR. This switch forces the \fB\-\-diff\fR mode on. .IP "\fB\-\-explain=LANG\fR" 4 .IX Item "--explain=LANG" Print the filters used to remove comments for language \s-1LANG\s0 and exit. In some cases the filters refer to Perl subroutines rather than regular expressions. An examination of the source code may be needed for further explanation. .IP "\fB\-\-help\fR" 4 .IX Item "--help" Print cloc's internal usage information and exit. .IP "\fB\-\-found=FILE\fR" 4 .IX Item "--found=FILE" Save names of every file found to \s-1FILE.\s0 .IP "\fB\-\-ignored=FILE\fR" 4 .IX Item "--ignored=FILE" Save names of ignored files and the reason they were ignored to \s-1FILE.\s0 .IP "\fB\-\-print\-filter\-stages\fR" 4 .IX Item "--print-filter-stages" Print to \fI\s-1STDOUT\s0\fR processed source code before and after each filter is applied. .IP "\fB\-\-show\-ext[=EXT]\fR" 4 .IX Item "--show-ext[=EXT]" Print information about all known (or just the given) file extensions and exit. .IP "\fB\-\-show\-lang[=LANG]\fR" 4 .IX Item "--show-lang[=LANG]" Print information about all known (or just the given) languages and exit. .IP "\fB\-\-show\-os\fR" 4 .IX Item "--show-os" Print the value of the operating system mode and exit. See also \&\fB\-\-unix\fR, \fB\-\-windows\fR. .IP "\fB\-v[=N]\fR" 4 .IX Item "-v[=N]" Turn on verbose with optional numeric value. .IP "\fB\-\-verbose[=N]\fR" 4 .IX Item "--verbose[=N]" Long form of \fB\-v\fR. .IP "\fB\-\-version\fR" 4 .IX Item "--version" Print the version of this program and exit. .IP "\fB\-\-write\-lang\-def=FILE\fR" 4 .IX Item "--write-lang-def=FILE" Writes to \s-1FILE\s0 the language processing filters then exits. Useful as a first step to creating custom language definitions. Note: languages which map to the same file extension will be excluded. See also \fB\-\-force\-lang\-def\fR, \fB\-\-read\-lang\-def\fR. .IP "\fB\-\-write\-lang\-def\-incl\-dup=FILE\fR" 4 .IX Item "--write-lang-def-incl-dup=FILE" Same as \fB\-\-write\-lang\-def\fR, but includes duplicated extensions. This generates a problematic language definition file because cloc will refuse to use it until duplicates are removed. .SS "Output Options" .IX Subsection "Output Options" .IP "\fB\-\-3\fR" 4 .IX Item "--3" Print third-generation language output. (This option can cause report summation to fail if some reports were produced with this option while others were produced without it.) .IP "\fB\-\-by\-percent X\fR" 4 .IX Item "--by-percent X" Instead of comment and blank line counts, show these values as percentages based on the value of X in the denominator: .Sp .Vb 4 \& X = \*(Aqc\*(Aq \-> # lines of code \& X = \*(Aqcm\*(Aq \-> # lines of code + comments \& X = \*(Aqcb\*(Aq \-> # lines of code + blanks \& X = \*(Aqcmb\*(Aq \-> # lines of code + comments + blanks .Ve .Sp For example, if using method 'c' and your code has twice as many lines of comments as lines of code, the value in the comment column will be 200%. The code column remains a line count. .IP "\fB\-\-csv\fR" 4 .IX Item "--csv" Write the results as comma separated values. .IP "\fB\-\-csv\-delimiter=C\fR" 4 .IX Item "--csv-delimiter=C" Use the character C as the delimiter for comma separated files instead of ,. This switch forces \fB\-\-csv\fR to be on. .IP "\fB\-\-hide\-rate\fR" 4 .IX Item "--hide-rate" Do not show line and file processing rates in the output header. This makes output deterministic. .IP "\fB\-\-json\fR" 4 .IX Item "--json" Write the results in JavaScript Object Notation (\s-1JSON\s0). .IP "\fB\-\-md\fR" 4 .IX Item "--md" Write the results as Markdown-formatted text. .IP "\fB\-\-out=FILE\fR" 4 .IX Item "--out=FILE" Synonym for \fB\-\-report\-file=FILE\fR. .IP "\fB\-\-progress\-rate=N\fR" 4 .IX Item "--progress-rate=N" Show progress update after every N files are processed (default N=100). Set N to 0 to suppress progress output; useful when redirecting output to \fI\s-1STDOUT\s0\fR. .IP "\fB\-\-quiet\fR" 4 .IX Item "--quiet" Suppress all information messages except for the final report. .IP "\fB\-\-report\-file=FILE\fR" 4 .IX Item "--report-file=FILE" Write the results to \s-1FILE\s0 instead of standard output. .IP "\fB\-\-sql=FILE\fR" 4 .IX Item "--sql=FILE" Write results as \s-1SQL CREATE\s0 and \s-1INSERT\s0 statements which can be read by a database program such as SQLite. If \s-1FILE\s0 is \fB\-\fR, output is sent to \&\fI\s-1STDOUT\s0\fR. .IP "\fB\-\-sql\-append\fR" 4 .IX Item "--sql-append" Append \s-1SQL\s0 insert statements to the file specified by \fB\-\-sql\fR and do not generate table creation option. .IP "\fB\-\-sql\-project=NAME\fR" 4 .IX Item "--sql-project=NAME" Use \fBname\fR as the project identifier for the current run. Only valid with the \fB\-\-sql\fR option. .IP "\fB\-\-sql\-style=STYLE\fR" 4 .IX Item "--sql-style=STYLE" Write \s-1SQL\s0 statements in the given style instead of the default SQLite format. Styles include \fBOracle\fR and \fBNamed_Columns\fR. .IP "\fB\-\-sum\-one\fR" 4 .IX Item "--sum-one" For plain text reports, show the \s-1SUM:\s0 output line even if only one input file is processed. .IP "\fB\-\-xml\fR" 4 .IX Item "--xml" Write the results in \s-1XML.\s0 .IP "\fB\-\-xsl[=FILE]\fR" 4 .IX Item "--xsl[=FILE]" Reference \s-1FILE\s0 as an \s-1XSL\s0 stylesheet within the \s-1XML\s0 output. If \s-1FILE\s0 is not given, writes a default stylesheet, cloc.xsl. This switch forces \&\fB\-\-xml\fR to be on. .IP "\fB\-\-yaml\fR" 4 .IX Item "--yaml" Write the results in \s-1YAML.\s0 .SH "EXAMPLES" .IX Header "EXAMPLES" Count the lines of code in the Perl 5.10.0 compressed tar file on a UNIX-like operating system: .PP .Vb 1 \& cloc perl\-5.10.0.tar.gz .Ve .PP Count the changes in files, code, and comments between Python releases 2.6.6 and 2.7: .PP .Vb 1 \& cloc \-\-diff Python\-2.6.6.tar.bz Python\-2.7.tar.bz2 .Ve .PP To see how cloc aligns files for comparison between two code bases, use the \fB\-\-diff\-alignment=FILE\fR option. Here the alignment information is written to \f(CW\*(C`align.txt\*(C'\fR: .PP .Vb 1 \& cloc \-\-diff\-aligment=align.txt gcc\-4.4.0.tar.bz2 gcc\-4.5.0.tar.bz2 .Ve .PP Count file, code, and comment changes between two git commits: .PP .Vb 1 \& cloc \-\-git \-\-diff b409850824 HEAD .Ve .PP Print the recognized languages: .PP .Vb 1 \& cloc \-\-show\-lang .Ve .PP Remove comments from \f(CW\*(C`foo.c\*(C'\fR and save the result in \f(CW\*(C`foo.c.nc\*(C'\fR (\*(L"nc\*(R" is an arbitrary extension; used here to denote \*(L"no comments\*(R"): .PP .Vb 1 \& cloc \-\-strip\-comments=nc foo.c .Ve .PP Additional examples can be found at . .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" None. .SH "FILES" .IX Header "FILES" None. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBsloccount\fR\|(1) .SH "AUTHORS" .IX Header "AUTHORS" The cloc program was written by Al Danial and is Copyright (C) 2006\-2018 . .PP The manual page was originally written by Jari Aalto . .PP Both the code and documentation is released under the \s-1GNU GPL\s0 version 2 or (at your option) any later version. For more information about license, visit .