about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_stgit11
1 files changed, 11 insertions, 0 deletions
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
     ;;