헤르메스 LIFE

[유틸] 소스코드 라인 카운트 본문

장난감들

[유틸] 소스코드 라인 카운트

헤르메스의날개 2012. 5. 22. 17:10
728x90

문 : http://sourceforge.net/projects/cloc/



cloc-1.56.exe




사용법


Usage: cloc-1.04.exe [options] <file(s)/dir(s)> | <report files>


 Count physical lines of source code in the given files and/or

 recursively below the given directories.


 Options:

   --by-file                 Report results for every source file encountered

                             in addition to reporting by language.

   --categorized=<file>      Save names of categorized files to <file>.

   --counted=<file>          Save names of processed source files to <file>.

   --exclude-dir=<D1>[,D2,]  Exclude the given comma separated directories

                             D1, D2, D3, et cetera, from being scanned.  For

                             example  --exclude-dir=.cvs,.svn  will skip

                             all files that have /.cvs/ or /.svn/ as part of

                             their path.

   --exclude-lang=<L1>[,L2,] Exclude the given comma separated languages

                             L1, L2, L3, et cetera, from being counted.

   --extract-with=<cmd>      Use <cmd> 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

                               --extract-with='gzip -dc >FILE< | tar xf -'

                             or, if you have GNU tar,

                               --extract-with='tar zxf >FILE<'

                             and on Windows use:

                               --extract-with="\"c:\Program Files\WinZip\WinZip3

2.exe\" -e -o >FILE< ."

                             (if WinZip is installed there).

   --force-lang=<lang>[,<ext>]

                             Process all files that have a <ext> extension

                             with the counter for language <lang>.  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

                               --force-lang="Fortran 90",f

                             If <ext> is omitted, every file will be counted

                             with the <lang> counter.  This option can be

                             specified multiple times (but that is only

                             useful when <ext> is given each time).

                             See also --script-lang.

   --found=<file>            Save names of every file found to <file>.

   --ignored=<file>          Save names of ignored files and the reason they

                             were ignored to <file>.

   --no3                     Suppress 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.

   --print-filter-stages     Print to STDOUT processed source code before and

                             after each filter is applied.

   --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 STDOUT).

   --quiet                   Suppress all information messages except for

                             the final report.

   --report-file=<file>      Write the results to <file> instead of STDOUT.

   --read-lang-def=<file>    Load from <file> the language processing filters.

                             (see also --write-lang-def) then use these filters

                             instead of the built-in filters.

   --script-lang=<lang>,<s>  Process all files that invoke <s> as a #!

                             scripting language with the counter for language

                             <lang>.  For example, files that begin with

                                #!/usr/local/bin/perl5.8.8

                             will be counted with the Perl counter by using

                                --script-lang=Perl,perl5.8.8

                             The language name is case insensitive but the

                             name of the script language executable, <s>,

                             must have the right case.  This option can be

                             specified multiple times.  See also --force-lang.

   --sdir=<dir>              Use <dir> as the scratch directory instead of

                             letting File::Temp chose the location.  Files

                             written to this location are not removed at

                             the end of the run (as they are with File::Temp).

   --show-ext[=<ext>]        Print information about all known (or just the

                             given) file extensions and exit.

   --show-lang[=<lang>]      Print information about all known (or just the

                             given) languages and exit.

   --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

                             .<ext> appended to it.

   --sum-reports             Input arguments are report files previously

                             created with the --report-file option.  Makes

                             a cumulative set of results containing the

                             sum of data from the individual report files.

   --unicode                 Check binary files to see if they contain Unicode

                             expanded ASCII text.  This causes performance to

                             drop noticably.

   --write-lang-def=<file>   Writes to <file> the language processing filters

                             then exits.  Useful as a first step to creating

                             custom language definitions (see --read-lang-def).

   -v[=<n>]                  Verbose switch (optional numeric value).

   --version                 Print the version of this program and exit.

   --csv                     Write the results as comma separated values.

   --xml                     Write the results in XML.

   --yaml                    Write the results in YAML.

728x90