Commit 077cd662 authored by Phillip Webb's avatar Phillip Webb

Add zsh shell completion script

parent fe0dd8e0
......@@ -26,6 +26,15 @@ set SPRING_HOME to point to a specific installation. You should also add SPRING
to your PATH environment variable.
Shell Completion
----------------
Shell auto-completion scripts are provided for BASH and ZSH. Add symlinks to the appropriate
location for your environment. For example, something like:
ln -s ./shell-completion/bash/spring /etc/bash_completion.d/spring
ln -s ./shell-completion/zsh/_spring /usr/local/share/zsh/site-functions/_spring
Checking Your Installation
--------------------------
To test if you have successfully install the CLI you can run the following command:
......
#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 "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment