_nvm 1.25 KB
Newer Older
1
2
3
#compdef nvm
#autoload

Luke Childs's avatar
Luke Childs committed
4
[[ -f "$NVM_DIR/nvm.sh" ]] || return 0
5

6
7
8
local -a _1st_arguments
_1st_arguments=(
  'help:show help'
9
10
  '--version:print out the latest released version of nvm'
  'install:download and install a version in <node|iojs|node version number>'
11
  'uninstall:uninstall a version'
12
13
14
15
  '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:list installed versions'
16
  'ls:list installed versions or versions matching a given description'
17
18
  'version:resolve the given description to a single local version'
  'version-remote:resolve the given description to a single remote version'
19
  'ls-remote:list remote versions available for install'
20
  'deactivate:undo effects of `nvm` on current shell'
21
22
  'alias:show or set aliases'
  'unalias:deletes an alias'
23
24
25
  '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'
26
27
28
29
30
31
32
)

_arguments -C '*:: :->subcmds' && return 0

if (( CURRENT == 1 )); then
  _describe -t commands "nvm subcommand" _1st_arguments
  return
33
fi