summaryrefslogtreecommitdiff
path: root/plugins/spring/_spring
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-09-23 18:53:05 -0400
committerAndrew Janke <andrew@apjanke.net>2015-09-23 18:53:05 -0400
commit96ff86142e9037e707f9cde8ab69e0425a0559c6 (patch)
tree217cb5e2b4a1c55afec79984c3c3c0a9efe2bf69 /plugins/spring/_spring
parent502f08b5e19716d43a7ec8b006178a7b017f68cd (diff)
parent76a26a2a59d8c6d0f65a4426cdb93920e255aea7 (diff)
downloadzsh-96ff86142e9037e707f9cde8ab69e0425a0559c6.tar.gz
zsh-96ff86142e9037e707f9cde8ab69e0425a0559c6.tar.bz2
zsh-96ff86142e9037e707f9cde8ab69e0425a0559c6.zip
Merge branch 'master' into installer-cygwin-support-3
Conflicts: tools/install.sh
Diffstat (limited to 'plugins/spring/_spring')
-rw-r--r--plugins/spring/_spring29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/spring/_spring b/plugins/spring/_spring
new file mode 100644
index 000000000..93f19517d
--- /dev/null
+++ b/plugins/spring/_spring
@@ -0,0 +1,29 @@
+#compdef spring 'spring'
+#autoload
+
+_spring() {
+
+ local cword
+ let cword=CURRENT-1
+
+ local hints
+ hints=()
+
+ local reply
+ while read -r line; do
+ reply=`echo "$line" | awk '{printf $1 ":"; for (i=2; i<NF; i++) printf $i " "; print $NF}'`
+ hints+=("$reply")
+ done < <(spring hint ${cword} ${words[*]})
+
+ if ((cword == 1)) {
+ _describe -t commands 'commands' hints
+ return 0
+ }
+
+ _describe -t options 'options' hints
+ _files
+
+ return 0
+}
+
+_spring "$@" \ No newline at end of file