1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00

Luka Perkov: 29624: _quilt: Improve push' and pop' completion.

This commit is contained in:
Frank Terbeck 2011-07-29 13:07:52 +00:00
parent 7d1480af54
commit d557905eb6
2 changed files with 34 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2011-07-29 Frank Terbeck <ft@bewatermyfriend.org>
* Luka Perkov: 29624: Completion/Unix/Command/_quilt: Improve
`push' and `pop' completion.
2011-07-28 Peter Stephenson <pws@csr.com> 2011-07-28 Peter Stephenson <pws@csr.com>
* 29626: Src/parse.c, Test/C04funcdef.ztst: arguments to * 29626: Src/parse.c, Test/C04funcdef.ztst: arguments to
@ -15179,5 +15184,5 @@
***************************************************** *****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL * This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5411 $ * $Revision: 1.5412 $
***************************************************** *****************************************************

View file

@ -1,5 +1,8 @@
#compdef quilt #compdef quilt
local -a tmp
local rc
_arguments \ _arguments \
'--trace' \ '--trace' \
'--quiltrc:config file:_files' \ '--quiltrc:config file:_files' \
@ -10,21 +13,37 @@ _arguments \
'*::subcmd:->subcmd' && return 0 '*::subcmd:->subcmd' && return 0
case "$state" in case "$state" in
(subcmd) (subcmd)
case "$words[1]" in case "$words[1]" in
(applied|delete|files|graph|header|next|previous|refresh|unapplied) (applied|delete|files|graph|header|next|previous|refresh|unapplied)
_wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"}
;; ;;
(push) (push)
_wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"} if (( CURRENT == 2 )); then
;; tmp=( ${(f)"$(quilt unapplied 2>&1)"} )
rc=$?
if (( rc == 0 )); then
_wanted -V 'unapplied patches' expl 'patch' compadd "${tmp[@]}"
else
_message "No unapplied patches"
fi
fi
;;
(pop) (pop)
_wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"} if (( CURRENT == 2 )); then
;; tmp=( ${(f)"$(quilt applied 2>&1)"} )
rc=$?
if (( rc == 0 )); then
_wanted -V 'applied patches' expl 'patch' compadd "${tmp[@]}"
else
_message "No applied patches"
fi
fi
;;
(*) (*)
_files _files
;; ;;
esac esac
;; ;;
esac esac