From dougkearns at gmail.com Tue Jul 12 01:53:55 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Jul 12 01:56:47 2005 Subject: [Rake-devel] zsh completion function Message-ID: <20050712055355.GR3833@localhost.localdomain> rake is becoming popular enough that the lack of completion was starting to annoy me so here it is... It should be pretty complete, if not, let me know. Regards, Doug -------------- next part -------------- #compdef rake # rake, version 0.5.4 local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C \ '(--dry-run -n)'{--dry-run,-n}'[do a dry run without executing actions]' \ '(- *)'{--help,-H}'[display help information]' \ \*{--libdir,-I}'[include specified directory in the search path for required modules]:library directory:_files -/' \ '(--nosearch -N)'{--nosearch,-N}'[do not search parent directories for the Rakefile]' \ '(- *)'{--prereqs,-P}'[display the tasks and prerequisites, then exit]' \ '(--quiet -q --silent -s --verbose -v)'{--quiet,-q}'[do not log messages to standard output]' \ '(--rakefile -f)'{--rakefile,-f}'[use specified file as the rakefile]:rake file:_files' \ \*{--require,-r}'[require specified module before executing rakefile]:library:->library' \ '(--quiet -q --silent -s --verbose -v)'{--silent,-s}"[like --quiet, but also suppresses the 'in directory' announcement]" \ '(- *)'{--tasks,-T}'[display the tasks and dependencies, then exit]' \ '(--trace -t)'{--trace,-t}'[turn on invoke/execute tracing, enable full backtrace]' \ '(- *)'{--usage,-h}'[display usage information]' \ '(--quiet -q --silent -s --verbose -v)'{--verbose,-v}'[log message to standard output (default)]' \ '(- *)'{--version,-V}'[display version information]' \ '*:target:->target' && ret=0 case "$state" in library) local -a dirs dirs=( $(_call_program directories ruby -e 'puts\ $:' 2>/dev/null) ${(s.:.)opt_args[-I]} ) _wanted libraries expl library _path_files -W dirs && ret=0 ;; target) local -a targets targets=( ${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/$match[1]:${match[2]:l}} ) if (( ! ${targets[(I)rake aborted!]} )) then _describe -t targets 'rake target' targets && ret=0 else _message -e targets 'rake target' fi ;; esac return ret From jim at weirichhouse.org Tue Jul 12 07:11:22 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Tue Jul 12 07:07:42 2005 Subject: [Rake-devel] zsh completion function In-Reply-To: <20050712055355.GR3833@localhost.localdomain> References: <20050712055355.GR3833@localhost.localdomain> Message-ID: <200507120711.23130.jim@weirichhouse.org> On Tuesday 12 July 2005 01:53 am, Doug Kearns wrote: > rake is becoming popular enough that the lack of completion was starting > to annoy me so here it is... It should be pretty complete, if not, let > me know. Thanks. I don't run zsh, so I'm unclear what to do with the file. I assume I just need to include it in the rake distribution for zsh users to find and activate themselves. Anything special beyond that? -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From dougkearns at gmail.com Thu Jul 14 00:48:48 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Jul 14 00:57:15 2005 Subject: [Rake-devel] zsh completion function In-Reply-To: <200507120711.23130.jim@weirichhouse.org> References: <20050712055355.GR3833@localhost.localdomain> <200507120711.23130.jim@weirichhouse.org> Message-ID: <20050714044847.GB4193@localhost.localdomain> Jim, On Tue, Jul 12, 2005 at 07:11:22AM -0400, Jim Weirich wrote: > I don't run zsh, so I'm unclear what to do with the file. I assume I just > need to include it in the rake distribution for zsh users to find and > activate themselves. I've committed this so it will be available in the next zsh release. It will, however, work with any recent version of zsh so if you have somewhere to put it in the Rake distribution, and you think it's useful, please do. > Anything special beyond that? No. Regards, Doug