mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
Implement plugin for Go Version Manager
This commit is contained in:
parent
62b0abdb6e
commit
507e9dc566
2 changed files with 35 additions and 0 deletions
30
plugins/gvm/_gvm
Normal file
30
plugins/gvm/_gvm
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#compdef gvm
|
||||
#autoload
|
||||
|
||||
[[ -f "$GVM_ROOT/scripts/gvm" ]] || return 0
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'version:print the gvm version number'
|
||||
'get:gets the latest code (for debugging)'
|
||||
'use:select a go version to use (--default to set permanently)'
|
||||
'diff:view changes to Go root'
|
||||
'help:display this usage text'
|
||||
'implode:completely remove gvm'
|
||||
'install:install go versions'
|
||||
'uninstall:uninstall go versions'
|
||||
'cross:install go cross compilers'
|
||||
'linkthis:link this directory into GOPATH'
|
||||
'list:list installed go versions'
|
||||
'listall:list available versions'
|
||||
'alias:manage go version aliases'
|
||||
'pkgset:manage go packages sets'
|
||||
'pkgenv:edit the environment for a package set'
|
||||
)
|
||||
|
||||
_arguments -C '*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "gvm subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
5
plugins/gvm/gvm.plugin.zsh
Normal file
5
plugins/gvm/gvm.plugin.zsh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Set GVM_ROOT if it isn't already defined
|
||||
[[ -z "$GVM_ROOT" ]] && export GVM_ROOT="$HOME/.gvm"
|
||||
|
||||
# Load gvm if it exists
|
||||
[[ -f "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
|
||||
Loading…
Add table
Add a link
Reference in a new issue