summaryrefslogtreecommitdiff
path: root/plugins/sdk/sdk.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2020-04-24 20:54:33 -0600
committerTuowen Zhao <ztuowen@gmail.com>2020-04-24 20:54:33 -0600
commitc197ad40f1dca62fd1e0e555e7bfc84e39f31223 (patch)
tree5c1e753e0ff2cb9d0e08a699f17352225b9ef9f1 /plugins/sdk/sdk.plugin.zsh
parent0b67340fd2fe9330d8487491e1983ad1a111fb2b (diff)
parent2560f04982dfc2693221c7c0f47d1a71df09a794 (diff)
downloadzsh-c197ad40f1dca62fd1e0e555e7bfc84e39f31223.tar.gz
zsh-c197ad40f1dca62fd1e0e555e7bfc84e39f31223.tar.bz2
zsh-c197ad40f1dca62fd1e0e555e7bfc84e39f31223.zip
Merge branch 'master' of https://github.com/ohmyzsh/ohmyzsh
Diffstat (limited to 'plugins/sdk/sdk.plugin.zsh')
-rw-r--r--plugins/sdk/sdk.plugin.zsh18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/sdk/sdk.plugin.zsh b/plugins/sdk/sdk.plugin.zsh
index d00459b16..e49caaf2f 100644
--- a/plugins/sdk/sdk.plugin.zsh
+++ b/plugins/sdk/sdk.plugin.zsh
@@ -7,10 +7,10 @@
# sdk offline <enable|disable>
#
# commands:
-# install or i <candidate> [version]
+# install or i <candidate> [version] [local-path]
# uninstall or rm <candidate> <version>
# list or ls [candidate]
-# use or u <candidate> [version]
+# use or u <candidate> <version>
# default or d <candidate> [version]
# current or c [candidate]
# upgrade or ug [candidate]
@@ -20,14 +20,15 @@
# offline [enable|disable]
# selfupdate [force]
# update
-# flush <candidates|broadcast|archives|temp>
+# flush <broadcast|archives|temp>
#
# candidate : the SDK to install: groovy, scala, grails, gradle, kotlin, etc.
# use list command for comprehensive list of candidates
# eg: $ sdk list
-#
# version : where optional, defaults to latest stable if not provided
# eg: $ sdk install groovy
+# local-path : optional path to an existing local installation
+# eg: $ sdk install groovy 2.4.13-local /opt/groovy-2.4.13
local _sdk_commands=(
install i
@@ -51,12 +52,13 @@ _listInstalledVersions() {
}
_listInstallableVersions() {
- __sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \
- sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*"
+ # Remove local (+) and installed (*) versions from the list
+ __sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[+*] [^ ]\+//g;s/>//g'
}
_listAllVersion() {
- __sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g"
+ # Remove (*), (+), and (>) characters from the list
+ __sdkman_list_versions $1 | sed -e '/^[^ ]/d;s/[*+>] //g'
}
_sdk () {
@@ -67,7 +69,7 @@ _sdk () {
compadd -- $SDKMAN_CANDIDATES ;;
offline) compadd -- enable disable ;;
selfupdate) compadd -- force ;;
- flush) compadd -- candidates broadcast archives temp ;;
+ flush) compadd -- broadcast archives temp ;;
esac
;;
4) case "$words[2]" in