_nvm 720 B

1234567891011121314151617181920212223242526
  1. #compdef nvm
  2. #autoload
  3. [[ -s ~/.nvm/nvm.sh ]] || return 0
  4. local -a _1st_arguments
  5. _1st_arguments=(
  6. 'help:show help'
  7. 'install:download and install a version'
  8. 'uninstall:uninstall a version'
  9. 'use:modify PATH to use version'
  10. 'run:run version with given arguments'
  11. 'ls:list installed versions or versions matching a given description'
  12. 'ls-remote:list remote versions available for install'
  13. 'deactivate:undo effects of NVM on current shell'
  14. 'alias:show or set aliases'
  15. 'unalias:deletes an alias'
  16. 'copy-packages:install global NPM packages to current version'
  17. )
  18. _arguments -C '*:: :->subcmds' && return 0
  19. if (( CURRENT == 1 )); then
  20. _describe -t commands "nvm subcommand" _1st_arguments
  21. return
  22. fi