about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexandre Rames <alexandre@uop.re>2014-09-04 15:28:11 +0100
committerPeter Stephenson <pws@zsh.org>2014-09-04 15:48:49 +0100
commited8602ee3f7f7082503e6f8fa71853199e61db31 (patch)
tree7d5f6602b094ee0ea217f426649c5d6bb93d61ca
parent2bff41d1f67a757962c7f1db5223ee676d10e7f5 (diff)
downloadzsh-ed8602ee3f7f7082503e6f8fa71853199e61db31.tar.gz
zsh-ed8602ee3f7f7082503e6f8fa71853199e61db31.tar.xz
zsh-ed8602ee3f7f7082503e6f8fa71853199e61db31.zip
33108: stgit --patch completion
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_stgit11
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c900eaa42..74a3a8a80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-09-04  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* Alexandre Rames: 33108: Completion/Unix/Command/_stgit:
+	--patch completion.
+
 	* 33091: Doc/Zsh/builtins.yo: improve documentation for ttyctl.
 
 2014-09-03  Barton E. Schaefer  <schaefer@zsh.org>
diff --git a/Completion/Unix/Command/_stgit b/Completion/Unix/Command/_stgit
index b2f2aeafa..6248267eb 100644
--- a/Completion/Unix/Command/_stgit
+++ b/Completion/Unix/Command/_stgit
@@ -32,6 +32,17 @@ else
 	compadd $(stg series --noprefix 2> /dev/null) \
 		&& ret=0
     ;;
+    (ref*)
+      last_word="$words[$CURRENT-1]"
+      refresh_patch_options=( -p --patch )
+      if [[ -n ${refresh_patch_options[(r)$last_word]} ]]; then
+	_wanted -V "applied patches" expl "patch" \
+	  compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##[+>] *}#[+>] } \
+		  && ret=0
+      else
+	_files
+      fi
+    ;;
     (*)
       _files
     ;;