CGVG (Command-line code browsing tools)

These are a pair of Perl scripts I wrote to give me the functionality of cscope(1), a tool which there was no good equivalent for in Open Source. Not too long afterwards, SCO released cscope under a BSD license, and I took to working on that as well. Regardless, cgvg remains useful (at least to me it does).

Most *nix hackers get by with using find(1) and grep(1), heck I'm one of them. This is in my .bashrc:

findgrep () {		# find | grep
	if [ $# -eq 0 ]; then
		echo "findgrep: No arguments entered."; return 1
	else
		# "{.[a-zA-Z],}*" instead of "." makes the output cleaner
		find {.[a-zA-Z],}* -type f | xargs grep -n $* /dev/null \
				2> /dev/null
	fi
}

I've just made a nicer front-end to doing something similar but more powerful. The idea is you can easily search for keywords in the code, and jump to the file and line where a match is found. Used with ctags(1), this can really help with jumping around and following code. Some features include a human-readable output, coloring, bolding (and alternate bolding), and just sheer convenience for a programmer.

cgvg uses the Perl internal find and does it's own searching, rather than being a wrapper for UNIX find(1) and grep(1). There is a ~/.cgvgrc file for per-user configuration, and some nice features like coloring, and multiple log files, rather than one global one (as was done in early versions).

Download the latest version - cgvg-1.6.3.tar.gz

View the README and ChangeLog files.

There's also a screenshot (png format... your browser may not support it) of it as an example.

This was written by me for me, but I'm happy to tailor it to other's needs as well of course, or include other's changes. Any and all suggestions are welcome. Heck, feel free to drop me an email and say hi if you like it and use it. :)