Skip to content

Commit a51cf5f

Browse files
Oliver Weilermarc0der
authored andcommitted
Add shell identifier
1 parent fed400c commit a51cf5f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/bash/sdkman-completion.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@
1717
#
1818

1919
function __sdk_completion() {
20+
local -r shell="$1"
21+
22+
case "$shell" in
23+
bash)
24+
__sdkman_completion_bash
25+
;;
26+
zsh)
27+
__sdkman_completion_zsh
28+
;;
29+
*)
30+
__sdkman_echo_red "No shell provided."
31+
32+
return 1
33+
esac
34+
}
35+
36+
function __sdkman_completion_bash() {
2037
\cat <<- 'EOF'
2138
_sdk_completion() {
2239
local -r previous_word="${COMP_WORDS[COMP_CWORD - 1]}"
@@ -57,4 +74,8 @@ function __sdk_completion() {
5774
5875
complete -o default -F _sdk_completion sdk
5976
EOF
77+
}
78+
79+
function __sdkman_completion_zsh() {
80+
__sdkman_echo_red "zsh is not supported yet!"
6081
}

0 commit comments

Comments
 (0)