_nvm 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #compdef nvm
  2. #autoload
  3. [[ -f "$NVM_DIR/nvm.sh" ]] || return 0
  4. local -a _1st_arguments
  5. _1st_arguments=(
  6. 'help:show help'
  7. '--version:print out the latest released version of nvm'
  8. 'install:download and install a version in <node|iojs|node version number>'
  9. 'uninstall:uninstall a version'
  10. 'use:modify PATH to use <version>. Uses .nvmrc if available'
  11. 'exec:run <command> on <version>. Uses .nvmrc if available'
  12. 'run:run `node` on <version> with <args> as arguments. Uses .nvmrc if available'
  13. 'current:list installed versions'
  14. 'ls:list installed versions or versions matching a given description'
  15. 'version:resolve the given description to a single local version'
  16. 'version-remote:resolve the given description to a single remote version'
  17. 'ls-remote:list remote versions available for install'
  18. 'deactivate:undo effects of `nvm` on current shell'
  19. 'alias:show or set aliases'
  20. 'unalias:deletes an alias'
  21. 'reinstall-packages:reinstall global `npm` packages contained in <version> to current version'
  22. 'unload:unload `nvm` from shell'
  23. 'which:display path to installed node version. Uses .nvmrc if available'
  24. )
  25. _arguments -C '*:: :->subcmds' && return 0
  26. if (( CURRENT == 1 )); then
  27. _describe -t commands "nvm subcommand" _1st_arguments
  28. return
  29. fi