概要
Cool, but obscure unix tools :: Software architect Kristof Kovacs
いろいろなコマンドがあるんですね、っていう話なので、とりあえず
Homebrewでclocを入れてみた。
導入
$ brew install cloc
使用例
左から、ファイル数、空白、コメント、ソースコードの行数が表示される。
cloc .emacs.d
6502 text files.
5205 unique files.
13456 files ignored.
http://cloc.sourceforge.net v 1.60 T=32.12 s (33.7 files/s, 14688.2 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
Lisp 935 52293 67810 333926
make 31 640 355 1969
Javascript 7 157 313 1474
C++ 13 434 343 1292
Java 8 174 300 1076
HTML 7 90 1 951
Bourne Shell 28 222 584 881
CSS 3 168 38 652
YAML 4 8 14 645
C 7 189 110 429
Python 7 255 405 409
Bourne Again Shell 1 113 189 404
Ruby 5 59 29 367
C/C++ Header 4 128 61 298
PHP 10 29 144 229
DOS Batch 1 23 1 166
XML 2 43 52 140
Lua 1 17 62 109
C Shell 1 29 98 97
Fortran 90 2 29 21 71
Perl 1 10 5 60
Tcl/Tk 1 3 9 15
Ada 1 0 0 4
Teamcenter def 1 0 5 3
--------------------------------------------------------------------------------
SUM: 1081 55113 70949 345667
--------------------------------------------------------------------------------