1 #-*- mode: shell-script;-*-
3 # darcs command line completion for zsh -- example
4 # Copyright 2002 "David Roundy" <droundy@abridgegame.org>
7 # Old zsh compctl style
12 reply=( $( darcs --commands | grep "^${prefix}" ) )
17 local first second prefix rest
19 read -c first second rest
20 reply=( $( darcs ${second} --list-option | grep "^${prefix}") )
22 # this would complete on files as well, if first and rest didn't match.
23 # since darcs does this when passed --list-option, no need
24 # compctl -F -x 'p[1,1]' -K _darcs_first - 'p[2,-1]' -K _darcs_rest -- darcs
25 compctl -x 'p[1,1]' -K _darcs_first - 'p[2,-1]' -K _darcs_rest -- darcs