From: Thomas Hurst Date: 2007-02-27T04:42:28+09:00 Subject: Re: [ANN] Bash completion for the gem command * Michael Schuerig (michael@schuerig.de) wrote: > To my surprise there apparently hasn't been support for bash command > line completion for the gem command. I've cobbled together a file that > add just that. See > > http://schuerig.de/michael/blog/index.php/2007/02/24/gem-bash-completion/ > > I've only tested it on Debian/Linux, on other Linux/Unix variants things > might work somewhat differently. Also, I don't even try to do > completion for gem names; doing that for remote gems would be much to > slow and I haven't looked into getting that information from the local > source_cache. I have this in my tcsh completions.rc, it provides basic command completion and completion for installed gems: set gemcommands=(build cert check cleanup repository contents \ dependency environment help install list outdated pristine \ query rdoc search sources specification uninstall unpack \ update repository) complete gem 'p/1/$gemcommands/' 'n/help/$gemcommands/' \ 'p%*%D:/usr/local/lib/ruby/gems/1.8/gems/% %' 'n/*/f:*/' I haven't bothered with option completion, but of course that can be added with a similar effort to yours. Remote gems should indeed be doable; it would mostly need a fast command to dump a list of gem names, or have something write them to a text file beforehand. If the full list is too big for that to be reasonable, the plaintext index could be split by prefix. -- Thomas 'Freaky' Hurst http://hur.st/