Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _stgit complete names of patches
- X-seq: zsh-workers 26978
- From: Julien Langer <julien.langer@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: _stgit complete names of patches
- Date: Fri, 22 May 2009 10:12:08 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=CAdXUXsZYjbWXaFLxyF5Rwz7ALANFYTvnAPvXeoXC+Y=; b=bqykmovE+whWwJRzsRQ5KoaB9lBW8ul2FgKjivBmiGnJfUS72WcueOLvbWCyjRrnS7 v7d0/TMFBaZI4vYfd8vnL0dMntc81APeFdjNlQXDzJdHBPj9AzOz9kCHt/d7OTo4r+xy If/FIgSVtYYb+6NgL5cDus7dRD+1RzAs221W0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=waEE3svgmJG4geynElucp8H2YpQ3MjJ6/pRoz5f0v/U3gP9fqwPVcFxkM+9UszPvB9 l+an7QYgEtAXiQ4Wl+RoYoNeBbRNusrUoMUU2d2GDFKwUP60WM2ttbAbE8vzq+ceN5NK dm75rTwIgnS0/hvZqWBl1vvxvZHrXjJu0r/1w=
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
This makes _stgit complete the names of patches.
- Julien
complete patchnames in _stgit
From: Julien Langer <julien.langer@xxxxxxxxx>
---
Completion/Unix/Command/_stgit | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/Completion/Unix/Command/_stgit b/Completion/Unix/Command/_stgit
index 69b5000..c8a3c8c 100644
--- a/Completion/Unix/Command/_stgit
+++ b/Completion/Unix/Command/_stgit
@@ -50,8 +50,33 @@ subcmds=(
'status:show the tree status'
)
+local curcontext="$curcontext"
+local subcmd
+local ret=1
+
if (( CURRENT == 2 )); then
- _describe -t commands 'stgit command' subcmds
+ _describe -t commands 'stgit command' subcmds && ret=0
else
- _files
+ shift words
+ (( CURRENT-- ))
+ subcmd="$words[1]"
+ curcontext="${curcontext%:*}-${subcmd}:"
+
+ case $subcmd in
+ (push)
+ _wanted -V "unapplied patches" expl "patch" compadd $(stg unapplied) \
+ && ret=0
+ ;;
+ (pop)
+ _wanted -V "applied patches" expl "patch" compadd $(stg applied) && ret=0
+ ;;
+ (edit|files|goto|rename|log|float|delete|sink|mail|sync|show|pick|hide)
+ _wanted -V "patches" expl "patch" compadd $(stg series --noprefix) && ret=0
+ ;;
+ (*)
+ _files
+ ;;
+ esac
fi
+
+return ret
Messages sorted by:
Reverse Date,
Date,
Thread,
Author