Saturday, April 21

Agile Programmable Completion - AccuRev + GNU Bash

When at the command line (CLI), productivity means keeping your hands on the keyboard. But once your fingers have memorized all the commands, flags, static arguments, and common usage patterns -- can you still get faster? Yes.

Programmable completion is a shell facility that allows for customizing the command line in real-time as it is typed. Also referred to as "TAB Completion", may shells in both Linux and Windows have a default implementation that support completion on filenames and directories. If you're lucky, you'll even get environment variables and functions.

Lets move to SCM. Various branch-based SCM systems like CVS, SVN, and P4 have basic tab completion of commands and flags. Thats a good start. But an agile user needs a context-sensitive, custom-data completion facility. What you ~really~ want is completion on your own data -- branch names, labels, usernames, etc. Users of stream-based AccuRev are in luck.

Do you use AccuRev on Linux? If so, download the latest GNU Bash (2.05+) completion for AccuRev 4.5.x. Here is the README. You'll never have to memorize flags or type stream names again.

Coming in Part 2 -- Support for Windows users.

3 comments:

Frank said...

Check out zsh sometime. The completion facility is much more fully formed, with support for argument completion and whatnot out of the box. Someday I'll get around to doing it, but if you did it first, that would be awesome.

Mohammed Hewedy said...

First time I've looked at accurev commands I recognized that it really a needs ".bash_completion" file.

Thank you for providing it :)

fepus said...

latest accurev tools (including completion) have been moved to: www.tools4accurev.com.

enjoy! - dave