1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 13:33:52 +01:00

Some improvements suggested by Oliver.

This commit is contained in:
Wayne Davison 2004-09-28 00:02:35 +00:00
parent db7e23754d
commit 1199a03348

@ -1,14 +1,11 @@
#compdef darcs
_darcs() {
# 1 based array
if (($CURRENT == 2)); then
compadd -- $( darcs --commands | grep "^$PREFIX" )
return 0
fi
compadd -- $( darcs ${words[2]} --list-option | grep "^$PREFIX" )
return 0
}
_darcs "$@"
if (($CURRENT == 2)); then
# We're completing the first word after "darcs" -- the command.
_wanted command expl 'darcs command' \
compadd -- $( darcs --commands )
else
# Find the options/files/URL/etc. for the current command by using darcs.
_wanted args expl 'arg for darcs command' \
compadd -- $( darcs ${words[2]} --list-option )
fi