_meteor 2.66 KB
Newer Older
1
2
3
4
5
6
#compdef meteor
#autoload

# Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
# Original author: Dimitri JORGE (https://github.com/jorge-d)

7
8
9
10
11
12
13
_meteor_all_packages() {
  packages=(`meteor list | cut -d" " -f1`)
}
_meteor_installed_packages() {
  installed_packages=(`meteor list --using`)
}

14
15
local -a _1st_arguments
_1st_arguments=(
16
17
18
19
20
21
22
23
24
25
  "add-platform:Add a platform to this project."
  "add:Add a package to this project."
  "admin:Administrative commands."
  "authorized:View or change authorized users and organizations for a site."
  "build:Build this project for all platforms."
  "claim:Claim a site deployed with an old Meteor version."
  "configure-android:Run the Android configuration tool from Meteor's ADK environment."
  "create:Create a new project."
  "debug:Run the project, but suspend the server process for debugging."
  "deploy:Deploy this project to Meteor."
26
  "install-sdk:Installs SDKs for a platform."
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  "lint:Build this project and run the linters printing all errors and warnings."
  "list-platforms:List the platforms added to your project."
  "list-sites:List sites for which you are authorized."
  "list:List the packages explicitly used by your project."
  "login:Log in to your Meteor developer account."
  "logout:Log out of your Meteor developer account."
  "logs:Show logs for specified site."
  "mongo:Connect to the Mongo database for the specified site."
  "publish-for-arch:Builds an already-published package for a new platform."
  "publish-release:Publish a new meteor release to the package server."
  "publish:Publish a new version of a package to the package server."
  "remove-platform:Remove a platform from this project."
  "remove:Remove a package from this project."
  "reset:Reset the project state. Erases the local database."
  "run:[default] Run this project in local development mode."
  "search:Search through the package server database."
  "shell:Launch a Node REPL for interactively evaluating server-side code."
  "show:Show detailed information about a release or package."
  "test-packages:Test one or more packages."
  "update:Upgrade this project's dependencies to their latest versions."
  "whoami:Prints the username of your Meteor developer account."
48
49
)

50
51
52
local expl
local -a packages installed_packages

53
54
55
56
57
58
59
if (( CURRENT == 2 )); then
  _describe -t commands "meteor subcommand" _1st_arguments
  return
fi

case "$words[2]" in
    help)
60
61
62
63
64
65
66
      _describe -t commands "meteor subcommand" _1st_arguments ;;
    remove)
      _meteor_installed_packages
      _wanted installed_packages expl 'installed packages' compadd -a installed_packages ;;
    add)
      _meteor_all_packages
      _wanted packages expl 'all packages' compadd -a packages ;;
67
esac