.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" ======================================================================== .\" .IX Title "cloc 1" .TH cloc 1 "2012-06-15" "cloc" "Devel" .\" 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 \- statistics utility to count lines of code .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& cloc [options] ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Count physical lines of source code in the given files (may be archives such as compressed tarballs or zip files) and/or recursively below the given directories. Counts blank lines, comment lines, and physical lines of source code in many programming languages. 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" .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 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: .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. See also \fB\-\-exclude\-list\-file\fR .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 noticably. .SS "Processing Options" .IX Subsection "Processing Options" .IP "B>\-\-by\-file>" 4 .IX Item "B>--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\-\-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. .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=" 4 .IX Item "--read-lang-def=" Load from the language processing filters. (see also \&\-\-write\-lang\-def) then use these filters instead of the built-in filters. .IP "\fB\-\-script\-lang=LANG," 4 .IX Item "--script-lang=LANG," Process all files that invoke 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, , 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\-\-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 lines and comments removed. 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 <\-\-original\-dir> 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. .SS "Filter Options" .IX Subsection "Filter Options" .IP "\fB\-\-exclude\-dir=DIR[,DIR ...]\fR" 4 .IX Item "--exclude-dir=DIR[,DIR ...]" 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`.cvs\*(C'\fR and \f(CW\*(C`.svn\*(C'\fR are always excluded. .IP "\fB\-\-exclude\-lang=LANG[,LANG ...]\fR" 4 .IX Item "--exclude-lang=LANG[,LANG ...]" 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 whose names appear in \s-1FILE\s0. \s-1FILE\s0 should have one entry per line. Relative path names will be resolved starting from the directory where cloc is invoked. See also \fB\-\-list\-file\fR. .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="^[Ww]idge" .Ve .IP "B>\-\-not\-match\-f=REGEX>" 4 .IX Item "B>--not-match-f=REGEX>" Count all files except those whose basenames match the Perl regex. .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\-\-help\fR" 4 .IX Item "--help" Print this 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 \s-1STDOUT\s0 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 "B>\-v[=NUMBER]>" 4 .IX Item "B>-v[=NUMBER]>" Turn on verbose with optional numeric value. .IP "\fB\-\-version\fR" 4 .IX Item "--version" Print the version of this program and exit. .IP "B>\-\-write\-lang\-def=FILE>" 4 .IX Item "B>--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. See \&\fB\-\-read\-lang\-def\fR. .SS "Output Options" .IX Subsection "Output Options" .IP "\fB\-\-no3\fR" 4 .IX Item "--no3" Suppress third-generation language output. This option can cause report summation to fail f some reports were produced with this option hile others were produced without it.) .IP "\fB\-\-progress\-rate=NUMBER\fR" 4 .IX Item "--progress-rate=NUMBER" Show progress update after every \s-1NUMBER\s0 files are processed (default NUMBER=100). Set \s-1NUMBER\s0 to 0 to suppress progress output; useful when redirecting output to \fIstdout\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 \s-1STDOUT\s0. .IP "\fB\-\-out=FILE\fR" 4 .IX Item "--out=FILE" Synonym for \fB\-\-report\-file=FILE\fR. .IP "\fB\-\-csv\fR" 4 .IX Item "--csv" Write the results as comma separated values. .IP "\fB\-\-sql=FILE\fR" 4 .IX Item "--sql=FILE" Write results as \s-1SQL\s0 create and insert statements which can be read by a database program such as SQLite. If \s-1FILE\s0 is 1, output is sent to \&\fIstdout\fR. .IP "\fB\-\-sql\-project=NAME\fR" 4 .IX Item "--sql-project=NAME" Use \s-1NAME\s0 as the project identifier for the current run. Only valid with the \fB\-\-sql\fR option. .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\-\-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" None (yet). .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" None. .SH "FILES" .IX Header "FILES" None. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIsloccount\fR\|(1) .SH "AUTHORS" .IX Header "AUTHORS" Program was written by Al Danial and is Copyright (C) 2006\-2010 Northrop Grumman Corporation, released under the \s-1GNU\s0 \s-1GPL\s0 version 2 or (at your option) any later version. .PP This manual page was written by Jari Aalto , for the Debian \s-1GNU\s0 system (but may be used by others). Updated by Jari Aalto . Released under license \s-1GNU\s0 \s-1GPL\s0 version 2 or (at your option) any later version. For more information about license, visit .