-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_zsh_sdkman.sh
executable file
·117 lines (102 loc) · 2.84 KB
/
_zsh_sdkman.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#compdef sdk
function _sdk() {
local -a commands
commands=(
'install:install a candidate version'
'i:install a candidate version'
'uninstall:uninstall a candidate version'
'rm:uninstall a candidate version'
'list:list available candidate versions'
'ls:list available candidate versions'
'use:use a candidate version in current shell'
'u:use a candidate version in current shell'
'default:set the default candidate version for every shell'
'd:set the default candidate version for every shell'
'current:display current candidate version'
'c:display current candidate version'
'upgrade:upgrade outdated candidate version'
'ug:upgrade outdated candidate version'
'version:display the current version of sdk'
'v:display the current version of sdk'
'broadcast:display the last broadcast message'
'b:display the last broadcast message'
'help:show the sdk help message'
'h:show the sdk help message'
'offline:enable or disable offline mode'
'selfupdate:update the sdk'
'flush:flush sdk local state'
)
local -a candidates
candidates=(
'ant:Ant'
'asciidoctorj:AsciidoctorJ'
'ceylon:Ceylon'
'crash:CRaSH'
'gaiden:Gaiden'
'glide:Glide'
'gradle:Gradle'
'grails:Grails'
'griffon:Griffon'
'groovy:Groovy'
'groovyserv:GroovyServ'
'java:Java'
'jbake:JBake'
'jbossforge:JBoss Forge'
'kobalt:Kobalt'
'kotlin:Kotlin'
'lazybones:Lazybones'
'leiningen:Leiningen'
'maven:Maven'
'sbt:sbt'
'scala:Scala'
'springboot:Spring Boot'
'sshoogr:Sshoogr'
'vertx:Vert.x'
)
local -a offline_modes
offline_modes=(
'enable:Enable offline mode'
'disable:Disable offline mode'
)
local -a selfupdate_options
selfupdate_options=(
'force:Force sdk self update'
)
local -a flush_options
flush_options=(
'candidates:Clears out the Candidate list'
'broadcast:Clears out the Broadcast cache'
'archives:Cleans the cache containing all downloaded SDK binaries'
'temp:Clears out the staging work folder'
)
local expl
_arguments \
'*:: :->subcmds' && return 0
case $CURRENT in
1)
_describe -t commands "sdk subcommand" commands
return
;;
2)
case "$words[1]" in
install|i|uninstall|rm|list|ls|use|u|default|d|current|c|upgrade|ug)
_describe -t commands "sdk subcommand" candidates
return
;;
offline)
_describe -t commands "sdk subcommand" offline_modes
return
;;
selfupdate)
_describe -t commands "sdk subcommand" selfupdate_options
return
;;
flush)
_describe -t commands "sdk subcommand" flush_options
return
;;
esac
;;
esac
}
_sdk "$@"