ac85faa262783f3e2f712a93293daa24c5fb10fb
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #4171 from linux-china/master
Spring Boot Plugin
Diff
1diff --git a/plugins/spring/README.md b/plugins/spring/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..62bfd8013e40eab1fea3aee86c7da58c4fde139f
4--- /dev/null
5+++ b/plugins/spring/README.md
6@@ -0,0 +1,25 @@
7+# Spring Boot oh-my-zsh plugin
8+oh-my-zsh Spring Boot plugin
9+
10+## Spring Boot autocomplete plugin
11+
12+- Adds autocomplete options for all spring boot commands.
13+
14+## Manual Install
15+
16+ $ cd ~/.oh-my-zsh/plugins
17+ $ git clone git@github.com:linux-china/oh-my-zsh-spring-boot-plugin.git spring
18+
19+Adjust your .zshrc file and add spring to plugins=(...)
20+
21+## Tips
22+
23+* Install Spring Cloud plugin: spring install org.springframework.cloud:spring-cloud-cli:1.0.2.RELEASE
24+
25+## Reference
26+
27+* Spring Boot: http://projects.spring.io/spring-boot/
28+* Spring Boot CLI: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#cli
29+
30+Maintainer : linux_china ([@linux_china](https://twitter.com/linux_china))
31+
32diff --git a/plugins/spring/_spring b/plugins/spring/_spring
33new file mode 100644
34index 0000000000000000000000000000000000000000..93f19517d51344e88637ea665f3c4d324b9ee67f
35--- /dev/null
36+++ b/plugins/spring/_spring
37@@ -0,0 +1,29 @@
38+#compdef spring 'spring'
39+#autoload
40+
41+_spring() {
42+
43+ local cword
44+ let cword=CURRENT-1
45+
46+ local hints
47+ hints=()
48+
49+ local reply
50+ while read -r line; do
51+ reply=`echo "$line" | awk '{printf $1 ":"; for (i=2; i<NF; i++) printf $i " "; print $NF}'`
52+ hints+=("$reply")
53+ done < <(spring hint ${cword} ${words[*]})
54+
55+ if ((cword == 1)) {
56+ _describe -t commands 'commands' hints
57+ return 0
58+ }
59+
60+ _describe -t options 'options' hints
61+ _files
62+
63+ return 0
64+}
65+
66+_spring "$@"