diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2004-09-28 00:02:35 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2004-09-28 00:02:35 +0000 |
commit | 1199a033489427afe57f95d7b86438da73587904 (patch) | |
tree | 5491bb1159b02829a7fb56b52d49f7f1230cd365 /Completion/Unix | |
parent | db7e23754d3bdf97ea8a3792ae071b47406ea027 (diff) | |
download | zsh-1199a033489427afe57f95d7b86438da73587904.tar.gz zsh-1199a033489427afe57f95d7b86438da73587904.tar.xz zsh-1199a033489427afe57f95d7b86438da73587904.zip |
Some improvements suggested by Oliver.
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Command/_darcs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Completion/Unix/Command/_darcs b/Completion/Unix/Command/_darcs index d5856fe32..7aa57643b 100644 --- a/Completion/Unix/Command/_darcs +++ b/Completion/Unix/Command/_darcs @@ -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 |