Skip to content

Commit 03ac5ac

Browse files
Oliver Weilermarc0der
authored andcommitted
Indent completion function
1 parent 391c3f2 commit 03ac5ac

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/main/bash/sdkman-completion.sh

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,39 @@
1717
#
1818

1919
function __sdk_completion() {
20-
cat <<- 'EOF'
20+
\cat <<- 'EOF'
2121
_sdk_completion() {
22-
local -r previous_word="${COMP_WORDS[COMP_CWORD - 1]}"
23-
local -r current_word="${COMP_WORDS[COMP_CWORD]}"
22+
local -r previous_word="${COMP_WORDS[COMP_CWORD - 1]}"
23+
local -r current_word="${COMP_WORDS[COMP_CWORD]}"
2424
25-
local candidates
25+
local candidates
2626
27-
case "$previous_word" in
28-
sdk)
29-
candidates=("install" "uninstall" "list" "use" "default" "home" "env" "current" "upgrade" "version" "broadcast" "help" "offline" "selfupdate" "update" "flush")
30-
;;
31-
env)
32-
candidates=("init install clear")
33-
;;
34-
current)
35-
candidates=()
27+
case "$previous_word" in
28+
sdk)
29+
candidates=("install" "uninstall" "list" "use" "default" "home" "env" "current" "upgrade" "version" "broadcast" "help" "offline" "selfupdate" "update" "flush")
30+
;;
31+
env)
32+
candidates=("init install clear")
33+
;;
34+
current)
35+
candidates=()
3636
37-
for candidate_path in "$SDKMAN_CANDIDATES_DIR"/*; do
38-
candidates+=("${candidate_path##*/}")
39-
done
40-
;;
41-
offline)
42-
candidates=("enable" "disable")
43-
;;
44-
selfupdate)
45-
candidates=("force")
46-
;;
47-
flush)
48-
candidates=("archives" "temp" "broadcast" "version")
49-
;;
50-
esac
37+
for candidate_path in "$SDKMAN_CANDIDATES_DIR"/*; do
38+
candidates+=("${candidate_path##*/}")
39+
done
40+
;;
41+
offline)
42+
candidates=("enable" "disable")
43+
;;
44+
selfupdate)
45+
candidates=("force")
46+
;;
47+
flush)
48+
candidates=("archives" "temp" "broadcast" "version")
49+
;;
50+
esac
5151
52-
COMPREPLY=($(compgen -W "${candidates[*]}" -- "$current_word"))
52+
COMPREPLY=($(compgen -W "${candidates[*]}" -- "$current_word"))
5353
}
5454
5555
complete -o default -F _sdk_completion sdk

0 commit comments

Comments
 (0)