From 6c0be92fa9973b73f33d2bf7c8add4e8ceb541c6 Mon Sep 17 00:00:00 2001 From: myfreeweb Date: Sun, 25 Sep 2011 16:35:30 +0400 Subject: [PATCH 1/2] added fab, heroku, lein, teamocil --- _fab | 4 ++ _heroku | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ _lein | 28 ++++++++++ _teamocil | 4 ++ 4 files changed, 193 insertions(+) create mode 100644 _fab create mode 100644 _heroku create mode 100644 _lein create mode 100644 _teamocil diff --git a/_fab b/_fab new file mode 100644 index 0000000..918a61f --- /dev/null +++ b/_fab @@ -0,0 +1,4 @@ +#compdef fab +#autoload + +compadd `fab --shortlist` diff --git a/_heroku b/_heroku new file mode 100644 index 0000000..d1017f6 --- /dev/null +++ b/_heroku @@ -0,0 +1,157 @@ +#compdef heroku + +# Heroku Autocomplete plugin for Oh-My-Zsh +# Requires: The Heroku client gem (https://github.com/heroku/heroku) +# Author: Ali B. (http://awhitebox.com) + +local -a _1st_arguments +_1st_arguments=( + "account\:confirm_billing":"Confirm that your account can be billed at the end of the month" + "addons":"list installed addons" + "addons\:list":"list all available addons" + "addons\:add":"install an addon" + "addons\:upgrade":"upgrade an existing addon" + "addons\:downgrade":"downgrade an existing addon" + "addons\:remove":"uninstall an addon" + "addons\:open":"open an addon's dashboard in your browser" + "apps":"list your apps" + "apps\:info":"show detailed app information" + "apps\:create":"create a new app" + "apps\:rename":"rename the app" + "apps\:open":"open the app in a web browser" + "apps\:destroy":"permanently destroy an app" + "auth\:login":"log in with your heroku credentials" + "auth\:logout":"clear local authentication credentials" + "config":"display the config vars for an app" + "config\:add":"add one or more config vars" + "config\:remove":"remove a config var" + "db\:push":"push local data up to your app" + "db\:pull":"pull heroku data down into your local database" + "domains":"list custom domains for an app" + "domains\:add":"add a custom domain to an app" + "domains\:remove":"remove a custom domain from an app" + "domains\:clear":"remove all custom domains from an app" + "help":"list available commands or display help for a specific command" + "keys":"display keys for the current user" + "keys\:add":"add a key for the current user" + "keys\:remove":"remove a key from the current user" + "keys\:clear":"remove all authentication keys from the current user" + "logs":"display recent log output" + "logs\:cron":"DEPRECATED: display cron logs from legacy logging" + "logs\:drains":"manage syslog drains" + "maintenance\:on":"put the app into maintenance mode" + "maintenance\:off":"take the app out of maintenance mode" + "pg\:info":"display database information" + "pg\:ingress":"allow direct connections to the database from this IP for one minute" + "pg\:promote":"sets DATABASE as your DATABASE_URL" + "pg\:psql":"open a psql shell to the database" + "pg\:reset":"delete all data in DATABASE" + "pg\:unfollow":"stop a replica from following and make it a read/write database" + "pg\:wait":"monitor database creation, exit when complete" + "pgbackups":"list captured backups" + "pgbackups\:url":"get a temporary URL for a backup" + "pgbackups\:capture":"capture a backup from a database id" + "pgbackups\:restore":"restore a backup to a database" + "pgbackups\:destroy":"destroys a backup" + "plugins":"list installed plugins" + "plugins\:install":"install a plugin" + "plugins\:uninstall":"uninstall a plugin" + "ps\:dynos":"scale to QTY web processes" + "ps\:workers":"scale to QTY background processes" + "ps":"list processes for an app" + "ps\:restart":"restart an app process" + "ps\:scale":"scale processes by the given amount" + "releases":"list releases" + "releases\:info":"view detailed information for a release" + "rollback":"roll back to an older release" + "run":"run an attached process" + "run\:rake":"remotely execute a rake command" + "run\:console":"open a remote console session" + "sharing":"list collaborators on an app" + "sharing\:add":"add a collaborator to an app" + "sharing\:remove":"remove a collaborator from an app" + "sharing\:transfer":"transfer an app to a new owner" + "ssl":"list certificates for an app" + "ssl\:add":"add an ssl certificate to an app" + "ssl\:remove":"remove an ssl certificate from an app" + "ssl\:clear":"remove all ssl certificates from an app" + "stack":"show the list of available stacks" + "stack\:migrate":"prepare migration of this app to a new stack" + "version":"show heroku client version" +) + +_arguments '*:: :->command' + +if (( CURRENT == 1 )); then + _describe -t commands "heroku command" _1st_arguments + return +fi + +local -a _command_args +case "$words[1]" in + apps:info) + _command_args=( + '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \ + ) + ;; + apps:create) + _command_args=( + '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \ + '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \ + '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \ + ) + ;; + config) + _command_args=( + '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \ + ) + ;; + db:push) + _command_args=( + '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ + '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ + '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \ + '(-f|--filter)'{-f,--filter}'[only push certain tables]' \ + '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ + '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \ + ) + ;; + db:pull) + _command_args=( + '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \ + '(-d|--debug)'{-d,--debug}'[enable debugging output]' \ + '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \ + '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \ + '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \ + '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \ + ) + ;; + keys) + _command_args=( + '(-l|--long)'{-l,--long}'[display extended information for each key]' \ + ) + ;; + logs) + _command_args=( + '(-n|--num)'{-n,--num}'[the number of lines to display]' \ + '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \ + '(-s|--source)'{-s,--source}'[only display logs from the given source]' \ + '(-t|--tail)'{-t,--tail}'[continually stream logs]' \ + ) + ;; + pgbackups:capture) + _command_args=( + '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \ + ) + ;; + stack) + _command_args=( + '(-a|--all)'{-a,--all}'[include deprecated stacks]' \ + ) + ;; + esac + +_arguments \ + $_command_args \ + '(--app)--app[the app name]' \ + && return 0 diff --git a/_lein b/_lein new file mode 100644 index 0000000..18eceb3 --- /dev/null +++ b/_lein @@ -0,0 +1,28 @@ +#compdef lein +#autoload + +# https://github.com/technolize/zsh-completion-funcs + +local ret=1 state +_arguments ':subcommand:->subcommand' && ret=0 + +case $state in + subcommand) + subcommands=( + "clean:remove compiled files and dependencies from project" + "compile:ahead-of-time compile the project" + "deps:download and install all dependencies" + "help:display a list of tasks or help for a given task" + "install:install the project and its dependencies in your local repository" + "jar:create a jar file containing the compiled .class files" + "new:create a new project skeleton" + "pom:write a pom.xml file to disk for maven interop" + "test:run the project's tests" + "uberjar:Create a jar including the contents of each of deps" + "upgrade:upgrade leiningen to the latest stable release" + "version:print leiningen's version" + ) + _describe -t subcommands 'leiningen subcommands' subcommands && ret=0 +esac + +return ret diff --git a/_teamocil b/_teamocil new file mode 100644 index 0000000..e0c64d5 --- /dev/null +++ b/_teamocil @@ -0,0 +1,4 @@ +#compdef teamocil +#autoload + +compadd `ls ~/.teamocil | sed 's/.yml//'` From 31769b05b366abc46477bcda99bf4d42f4d140c8 Mon Sep 17 00:00:00 2001 From: myfreeweb Date: Sun, 25 Sep 2011 16:46:14 +0400 Subject: [PATCH 2/2] proper headers for these --- _fab | 27 +++++++++++++++++++++++++-- _heroku | 20 ++++++++++++++++---- _lein | 19 ++++++++++++++++--- _teamocil | 27 +++++++++++++++++++++++++-- 4 files changed, 82 insertions(+), 11 deletions(-) diff --git a/_fab b/_fab index 918a61f..c6249e6 100644 --- a/_fab +++ b/_fab @@ -1,4 +1,27 @@ #compdef fab -#autoload +# ------------------------------------------------------------------------------ +# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +# Version 2, December 2004 +# +# Copyright (C) 2011 Grigory V. +# +# Everyone is permitted to copy and distribute verbatim or modified +# copies of this license document, and changing it is allowed as long +# as the name is changed. +# +# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +# +# 0. You just DO WHAT THE FUCK YOU WANT TO. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for Fabric (http://fabfile.org) +# +# ------------------------------------------------------------------------------ +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------ -compadd `fab --shortlist` +compadd `fab --shortlist` \ No newline at end of file diff --git a/_heroku b/_heroku index d1017f6..388ee6b 100644 --- a/_heroku +++ b/_heroku @@ -1,8 +1,20 @@ #compdef heroku - -# Heroku Autocomplete plugin for Oh-My-Zsh -# Requires: The Heroku client gem (https://github.com/heroku/heroku) -# Author: Ali B. (http://awhitebox.com) +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for the Heroku client gem (https://github.com/heroku/heroku) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Ali B. (http://awhitebox.com) +# +# ------------------------------------------------------------------------------ +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------ local -a _1st_arguments _1st_arguments=( diff --git a/_lein b/_lein index 18eceb3..2fdd943 100644 --- a/_lein +++ b/_lein @@ -1,7 +1,20 @@ #compdef lein -#autoload - -# https://github.com/technolize/zsh-completion-funcs +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for Leiningen (https://github.com/technomancy/leiningen) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * https://github.com/technolize +# +# ------------------------------------------------------------------------------ +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------ local ret=1 state _arguments ':subcommand:->subcommand' && ret=0 diff --git a/_teamocil b/_teamocil index e0c64d5..5f1dbdc 100644 --- a/_teamocil +++ b/_teamocil @@ -1,4 +1,27 @@ #compdef teamocil -#autoload +# ------------------------------------------------------------------------------ +# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +# Version 2, December 2004 +# +# Copyright (C) 2011 Grigory V. +# +# Everyone is permitted to copy and distribute verbatim or modified +# copies of this license document, and changing it is allowed as long +# as the name is changed. +# +# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +# +# 0. You just DO WHAT THE FUCK YOU WANT TO. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for Teamocil (https://github.com/remiprev/teamocil) +# +# ------------------------------------------------------------------------------ +# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- +# vim: ft=zsh sw=2 ts=2 et +# ------------------------------------------------------------------------------ -compadd `ls ~/.teamocil | sed 's/.yml//'` +compadd `ls ~/.teamocil | sed 's/.yml//'` \ No newline at end of file