summaryrefslogtreecommitdiff
path: root/plugins/meteor
diff options
context:
space:
mode:
authorPavol Juhas <pavol.juhas@gmail.com>2014-03-17 19:48:10 -0400
committerPavol Juhas <pavol.juhas@gmail.com>2014-03-17 19:48:10 -0400
commit6952105bfe1fd4121fd355dc5f8ec5e03de5541c (patch)
tree604e65e52df88e28f99f49b939aa9547eb009b1c /plugins/meteor
parented19ffee5ecc0db6617c1ae753e515d60cb486c6 (diff)
parentca900216302aa1138c793971cf877b5d4e88fb06 (diff)
downloadzsh-6952105bfe1fd4121fd355dc5f8ec5e03de5541c.tar.gz
zsh-6952105bfe1fd4121fd355dc5f8ec5e03de5541c.tar.bz2
zsh-6952105bfe1fd4121fd355dc5f8ec5e03de5541c.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/meteor')
-rw-r--r--plugins/meteor/_meteor48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/meteor/_meteor b/plugins/meteor/_meteor
new file mode 100644
index 000000000..cd7fc304f
--- /dev/null
+++ b/plugins/meteor/_meteor
@@ -0,0 +1,48 @@
+#compdef meteor
+#autoload
+
+# Meteor Autocomplete plugin for Oh-My-Zsh, based on homebrew completion
+# Original author: Dimitri JORGE (https://github.com/jorge-d)
+
+_meteor_all_packages() {
+ packages=(`meteor list | cut -d" " -f1`)
+}
+_meteor_installed_packages() {
+ installed_packages=(`meteor list --using`)
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+ 'run:[Default] Run this project in local development mode'
+ 'create:Create a new project'
+ 'update:Upgrade this project to the latest version of Meteor'
+ 'add:Add a package to this project'
+ 'remove:Remove a package from this project'
+ 'list:List available packages'
+ 'help:Display Meteor help'
+ 'bundle:Pack this project up into a tarball'
+ 'mongo:Connect to the Mongo database for the specified site'
+ 'deploy:Deploy this project to Meteor'
+ 'logs:Show logs for specified site'
+ 'reset:Reset the project state. Erases the local database.'
+ 'test-packages:Test one or more packages'
+)
+
+local expl
+local -a packages installed_packages
+
+if (( CURRENT == 2 )); then
+ _describe -t commands "meteor subcommand" _1st_arguments
+ return
+fi
+
+case "$words[2]" in
+ help)
+ _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 ;;
+esac \ No newline at end of file