ohmyzsh/plugins/nvm/_nvm
Tyler Cross 73c160fdca Allow setting path to nvm install dir.
- same behavior as the two lines the nvm install script puts in bashrc
- set NVM_DIR to path where nvm is installed
- allows for global installs in /opt or /usr/local
2015-04-28 06:35:27 -04:00

26 lines
No EOL
727 B
Text

#compdef nvm
#autoload
[[ -s "${NVM_DIR:=~/.nvm}" ]] || return 0
local -a _1st_arguments
_1st_arguments=(
'help:show help'
'install:download and install a version'
'uninstall:uninstall a version'
'use:modify PATH to use version'
'run:run version with given arguments'
'ls:list installed versions or versions matching a given description'
'ls-remote:list remote versions available for install'
'deactivate:undo effects of NVM on current shell'
'alias:show or set aliases'
'unalias:deletes an alias'
'copy-packages:install global NPM packages to current version'
)
_arguments -C '*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "nvm subcommand" _1st_arguments
return
fi