about summary refs log tree commit diff
path: root/Completion/Zsh/Function
diff options
context:
space:
mode:
authorDaniel Shahaf <danielsh@apache.org>2020-02-17 09:56:54 +0000
committerDaniel Shahaf <danielsh@apache.org>2020-02-19 10:18:30 +0000
commit50df0e0bb9309319af9a3ee59a31766d3f1ba6bf (patch)
tree087068dd2e18227e61dbd7a73ce7cd5991150f44 /Completion/Zsh/Function
parent69c247de2ff3ca41be93cd90af539926418d023d (diff)
downloadzsh-50df0e0bb9309319af9a3ee59a31766d3f1ba6bf.tar.gz
zsh-50df0e0bb9309319af9a3ee59a31766d3f1ba6bf.tar.xz
zsh-50df0e0bb9309319af9a3ee59a31766d3f1ba6bf.zip
45447: Complete vcs_info_hookadd and vcs_info_hookdel. Expose _vcs_info_hooks as a top-level helper function.
Diffstat (limited to 'Completion/Zsh/Function')
-rw-r--r--Completion/Zsh/Function/_vcs_info31
1 files changed, 31 insertions, 0 deletions
diff --git a/Completion/Zsh/Function/_vcs_info b/Completion/Zsh/Function/_vcs_info
new file mode 100644
index 000000000..fdb28de6a
--- /dev/null
+++ b/Completion/Zsh/Function/_vcs_info
@@ -0,0 +1,31 @@
+#compdef vcs_info_hookadd vcs_info_hookdel
+
+local -a hook_types=(
+  gen-applied-string
+  gen-hg-bookmark-string
+  gen-mqguards-string
+  gen-unapplied-string
+  no-vcs
+  post-backend
+  post-quilt
+  pre-addon-quilt
+  pre-get-data
+  set-branch-format
+  set-hgrev-format
+  set-message
+  set-patch-format
+  start-up
+)
+
+local -a specs
+case $service in
+  (vcs_info_hookdel)
+    specs=( '-a[remove all occurrences, not just the first]' )
+    ;;
+esac
+
+# TODO: for vcs_info_hookdel complete only functions installed for that hook
+_arguments : \
+  $specs \
+  ":hook type:($hook_types)" \
+  '*:hook function:_vcs_info_hooks'