aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsanmiguel <[email protected]>2017-02-18 13:59:49 +0100
committersanmiguel <[email protected]>2017-02-18 13:59:49 +0100
commit2793ae422651b40689f61839a9b60bbe65fb2ef9 (patch)
tree30addc5958f1b298c3015e30b6c78f0047fbdb99
parent9a3205b326eda1b906c8078c11af914fec2be1fb (diff)
downloadkerl-2793ae422651b40689f61839a9b60bbe65fb2ef9.tar.gz
kerl-2793ae422651b40689f61839a9b60bbe65fb2ef9.tar.bz2
kerl-2793ae422651b40689f61839a9b60bbe65fb2ef9.zip
Add kerl path to zsh completions
-rw-r--r--zsh_completion/_kerl14
1 files changed, 14 insertions, 0 deletions
diff --git a/zsh_completion/_kerl b/zsh_completion/_kerl
index e58eb8b..7c9f0d6 100644
--- a/zsh_completion/_kerl
+++ b/zsh_completion/_kerl
@@ -30,6 +30,10 @@ _kerl_installations() {
installations=(${(f)"$(_call_program installations kerl list installations 2>/dev/null | cut -f 2 -d " ")"})
}
+_kerl_installnames() {
+ installnames=(${(f)"$(_call_program installations kerl list installations 2>/dev/null | cut -f 2 -d " " | xargs basename)"})
+}
+
local -a _1st_arguments
_1st_arguments=(
'build:Build specified release or git repository'
@@ -39,6 +43,7 @@ _1st_arguments=(
'list:List releases, builds and installations'
'delete:Delete builds and installations'
'active:Print the path of the active installation'
+ 'path:Print the path of any installation'
'status:Print available builds and installations'
'prompt:Print a string suitable for insertion in prompt'
'cleanup:Remove compilation artifacts (use after installation)'
@@ -96,6 +101,15 @@ case "$words[1]" in
# TODO: suggest starting location of "$KERLDIR/$(lowercase $build)"
_directories
;;
+ path)
+ _arguments \
+ '1: :->installnames' && return 0
+ if [[ "$state" == installnames ]]; then
+ _kerl_installnames
+ _wanted installnames expl '' compadd -a installnames
+ return
+ fi
+ ;;
deploy)
_arguments \
'1: :->hosts' \