zsh-nvm/_nvm
2020-04-06 09:47:37 +02:00

37 lines
1.5 KiB
Plaintext

#compdef nvm
#autoload
[[ -f "$NVM_DIR/nvm.sh" ]] || return 0
local -a _1st_arguments
_1st_arguments=(
'--help:Show help'
'--version:Print out the installed version of nvm'
'install:Download and install a <version>, [-s] from source. Uses .nvmrc if available'
'uninstall:Uninstall a version'
'use:Modify PATH to use <version>. Uses .nvmrc if available'
'exec:Run <command> on <version>. Uses .nvmrc if available'
'run:Run `node` on <version> with <args> as arguments. Uses .nvmrc if available'
'current:Display currently activated version of Node'
'ls:List installed versions, matching a given <version> if provided'
'ls-remote:List remote versions available for install, matching a given <version> if provided'
'version:Resolve the given description to a single local version'
'version-remote:Resolve the given description to a single remote version'
'deactivate:Undo effects of `nvm` on current shell'
'alias:Show all aliases beginning with <pattern>'
'unalias:Deletes the alias named <name>'
'install-latest-npm:Attempt to upgrade to the latest working `npm` on the current node version'
'reinstall-packages:Reinstall global `npm` packages contained in <version> to current version'
'unload:Unload `nvm` from shell'
'which:Display path to installed node version. Uses .nvmrc if available'
'upgrade:Upgrade to the latest release of `nvm`'
'revert:Revert back to the previously installed version'
)
_arguments -C '*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "nvm subcommand" _1st_arguments
return
fi