diff --git a/spring-boot-cli/src/main/content/INSTALL.txt b/spring-boot-cli/src/main/content/INSTALL.txt index 42d6045f811..f273907c56e 100644 --- a/spring-boot-cli/src/main/content/INSTALL.txt +++ b/spring-boot-cli/src/main/content/INSTALL.txt @@ -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: diff --git a/spring-boot-cli/src/main/content/bash_completion.d/spring b/spring-boot-cli/src/main/content/shell-completion/bash/spring similarity index 100% rename from spring-boot-cli/src/main/content/bash_completion.d/spring rename to spring-boot-cli/src/main/content/shell-completion/bash/spring diff --git a/spring-boot-cli/src/main/content/shell-completion/zsh/_spring b/spring-boot-cli/src/main/content/shell-completion/zsh/_spring new file mode 100755 index 00000000000..a2ce4038e3b --- /dev/null +++ b/spring-boot-cli/src/main/content/shell-completion/zsh/_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