_meteor 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #compdef meteor
  2. #autoload
  3. # Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
  4. # Original author: Dimitri JORGE (https://github.com/jorge-d)
  5. _meteor_all_packages() {
  6. packages=(`meteor list | cut -d" " -f1`)
  7. }
  8. _meteor_installed_packages() {
  9. installed_packages=(`meteor list --using`)
  10. }
  11. local -a _1st_arguments
  12. _1st_arguments=(
  13. 'run:[Default] Run this project in local development mode'
  14. 'create:Create a new project'
  15. 'update:Upgrade this project to the latest version of Meteor'
  16. 'add:Add a package to this project'
  17. 'remove:Remove a package from this project'
  18. 'list:List available packages'
  19. 'help:Display Meteor help'
  20. 'bundle:Pack this project up into a tarball'
  21. 'mongo:Connect to the Mongo database for the specified site'
  22. 'deploy:Deploy this project to Meteor'
  23. 'logs:Show logs for specified site'
  24. 'reset:Reset the project state. Erases the local database.'
  25. 'test-packages:Test one or more packages'
  26. )
  27. local expl
  28. local -a packages installed_packages
  29. if (( CURRENT == 2 )); then
  30. _describe -t commands "meteor subcommand" _1st_arguments
  31. return
  32. fi
  33. case "$words[2]" in
  34. help)
  35. _describe -t commands "meteor subcommand" _1st_arguments ;;
  36. remove)
  37. _meteor_installed_packages
  38. _wanted installed_packages expl 'installed packages' compadd -a installed_packages ;;
  39. add)
  40. _meteor_all_packages
  41. _wanted packages expl 'all packages' compadd -a packages ;;
  42. esac