The Ohloh source code line counter
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation.
Ohcount is specifically licensed under GPL v2.0, and no later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Ohcount supports multiple languages within a single file: for example a complex HTML document might include regions of both CSS and Javascript.
Ohcount has 4 main components:
git clone http://git.ohloh.net/git/ohcount.git
$ ./build
You may then link or copy 'bin/ohcount' to your system's PATH.
Building the Ruby extension of Ohcount requires:
$ ./build ruby
You may then link or copy 'ruby/ohcount.{rb,so}' and 'ruby/gestalt{/,.rb}' to the appropriate places in your Ruby installation.
$ ohcount helloworld.c
Directories will be probed recursively. If you do not pass any parameters, the current directory tree will be counted.
You can use the ohcount 'detect' option to simply determine the language family of each source file. The files will not be parsed or counted. For example, to find all of the Ruby files in the current directory tree:
$ ohcount --detect | grep ^ruby
The 'annotate' option presents a line-by-line accounting of the languages used in a source code file. For example:
$ ohcount --annotate ./test/src_dir/php1.php
More options can be found by typing:
$ ohcount --help
You can reach Ohloh via email at: info@ohloh.net