06b0276675e978d80535259915fbb44011e10101

Author
Ross Goldberg <rgoldberg@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

sdk: support completion of new commands in 5.8.0 (#8870)

Diff

 1diff --git a/plugins/sdk/sdk.plugin.zsh b/plugins/sdk/sdk.plugin.zsh
 2index a1069fea4b1e5badb580cf5d9343e4f8062c5783..441bd6ff4cf972ecfdac69c3bd489488024cc04d 100644
 3--- a/plugins/sdk/sdk.plugin.zsh
 4+++ b/plugins/sdk/sdk.plugin.zsh
 5@@ -13,9 +13,12 @@ _sdk() {
 6 		l|ls|list|i|install)
 7 			compadd -X $'Candidates:\n' -- "${SDKMAN_CANDIDATES[@]}"
 8 			;;
 9-		ug|upgrade|c|current|u|use|d|default|rm|uninstall)
10+		ug|upgrade|h|home|c|current|u|use|d|default|rm|uninstall)
11 			compadd -X $'Installed Candidates:\n' -- "${${(u)${(f)$(find -L -- "${SDKMAN_CANDIDATES_DIR}" -mindepth 2 -maxdepth 2 -type d)}[@]:h}[@]:t}"
12 			;;
13+		e|env)
14+			compadd init
15+			;;
16 		offline)
17 			compadd enable disable
18 			;;
19@@ -37,7 +40,7 @@ _sdk() {
20 				compadd -X "Installable Versions of ${words[3]}:"$'\n' -- "${${(z)${(M)${(f)${$(__sdkman_list_versions "${words[3]}")//[*+>]+( )/-}}[@]:# *}[@]}[@]:#-*}"
21 			fi
22 			;;
23-		u|use|d|default|rm|uninstall)
24+		h|home|u|use|d|default|rm|uninstall)
25 			compadd -X "Installed Versions of ${words[3]}:"$'\n' -- "${${(f)$(find -L -- "${SDKMAN_CANDIDATES_DIR}/${words[3]}" -mindepth 1 -maxdepth 1 -type d -not -name 'current')}[@]:t}"
26 			;;
27 		esac