_heroku 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #compdef heroku
  2. # Heroku Autocomplete plugin for Oh-My-Zsh
  3. # Requires: The Heroku client gem (https://github.com/heroku/heroku)
  4. # Author: Ali B. (http://awhitebox.com)
  5. local -a _1st_arguments
  6. _1st_arguments=(
  7. "account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
  8. "addons":"list installed addons"
  9. "addons\:list":"list all available addons"
  10. "addons\:add":"install an addon"
  11. "addons\:upgrade":"upgrade an existing addon"
  12. "addons\:downgrade":"downgrade an existing addon"
  13. "addons\:remove":"uninstall an addon"
  14. "addons\:open":"open an addon's dashboard in your browser"
  15. "apps":"list your apps"
  16. "apps\:info":"show detailed app information"
  17. "apps\:create":"create a new app"
  18. "apps\:rename":"rename the app"
  19. "apps\:open":"open the app in a web browser"
  20. "apps\:destroy":"permanently destroy an app"
  21. "auth\:login":"log in with your heroku credentials"
  22. "auth\:logout":"clear local authentication credentials"
  23. "config":"display the config vars for an app"
  24. "config\:add":"add one or more config vars"
  25. "config\:remove":"remove a config var"
  26. "db\:push":"push local data up to your app"
  27. "db\:pull":"pull heroku data down into your local database"
  28. "domains":"list custom domains for an app"
  29. "domains\:add":"add a custom domain to an app"
  30. "domains\:remove":"remove a custom domain from an app"
  31. "domains\:clear":"remove all custom domains from an app"
  32. "help":"list available commands or display help for a specific command"
  33. "keys":"display keys for the current user"
  34. "keys\:add":"add a key for the current user"
  35. "keys\:remove":"remove a key from the current user"
  36. "keys\:clear":"remove all authentication keys from the current user"
  37. "logs":"display recent log output"
  38. "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
  39. "logs\:drains":"manage syslog drains"
  40. "maintenance\:on":"put the app into maintenance mode"
  41. "maintenance\:off":"take the app out of maintenance mode"
  42. "pg\:info":"display database information"
  43. "pg\:ingress":"allow direct connections to the database from this IP for one minute"
  44. "pg\:promote":"sets DATABASE as your DATABASE_URL"
  45. "pg\:psql":"open a psql shell to the database"
  46. "pg\:reset":"delete all data in DATABASE"
  47. "pg\:unfollow":"stop a replica from following and make it a read/write database"
  48. "pg\:wait":"monitor database creation, exit when complete"
  49. "pgbackups":"list captured backups"
  50. "pgbackups\:url":"get a temporary URL for a backup"
  51. "pgbackups\:capture":"capture a backup from a database id"
  52. "pgbackups\:restore":"restore a backup to a database"
  53. "pgbackups\:destroy":"destroys a backup"
  54. "plugins":"list installed plugins"
  55. "plugins\:install":"install a plugin"
  56. "plugins\:uninstall":"uninstall a plugin"
  57. "ps\:dynos":"scale to QTY web processes"
  58. "ps\:workers":"scale to QTY background processes"
  59. "ps":"list processes for an app"
  60. "ps\:restart":"restart an app process"
  61. "ps\:scale":"scale processes by the given amount"
  62. "releases":"list releases"
  63. "releases\:info":"view detailed information for a release"
  64. "rollback":"roll back to an older release"
  65. "run":"run an attached process"
  66. "run\:rake":"remotely execute a rake command"
  67. "run\:console":"open a remote console session"
  68. "sharing":"list collaborators on an app"
  69. "sharing\:add":"add a collaborator to an app"
  70. "sharing\:remove":"remove a collaborator from an app"
  71. "sharing\:transfer":"transfer an app to a new owner"
  72. "ssl":"list certificates for an app"
  73. "ssl\:add":"add an ssl certificate to an app"
  74. "ssl\:remove":"remove an ssl certificate from an app"
  75. "ssl\:clear":"remove all ssl certificates from an app"
  76. "stack":"show the list of available stacks"
  77. "stack\:migrate":"prepare migration of this app to a new stack"
  78. "version":"show heroku client version"
  79. )
  80. _arguments '*:: :->command'
  81. if (( CURRENT == 1 )); then
  82. _describe -t commands "heroku command" _1st_arguments
  83. return
  84. fi
  85. local -a _command_args
  86. case "$words[1]" in
  87. apps:info)
  88. _command_args=(
  89. '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
  90. )
  91. ;;
  92. apps:create)
  93. _command_args=(
  94. '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
  95. '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
  96. '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
  97. )
  98. ;;
  99. config)
  100. _command_args=(
  101. '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
  102. )
  103. ;;
  104. db:push)
  105. _command_args=(
  106. '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
  107. '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
  108. '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
  109. '(-f|--filter)'{-f,--filter}'[only push certain tables]' \
  110. '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
  111. '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
  112. )
  113. ;;
  114. db:pull)
  115. _command_args=(
  116. '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
  117. '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
  118. '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
  119. '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
  120. '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
  121. '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
  122. )
  123. ;;
  124. keys)
  125. _command_args=(
  126. '(-l|--long)'{-l,--long}'[display extended information for each key]' \
  127. )
  128. ;;
  129. logs)
  130. _command_args=(
  131. '(-n|--num)'{-n,--num}'[the number of lines to display]' \
  132. '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
  133. '(-s|--source)'{-s,--source}'[only display logs from the given source]' \
  134. '(-t|--tail)'{-t,--tail}'[continually stream logs]' \
  135. )
  136. ;;
  137. pgbackups:capture)
  138. _command_args=(
  139. '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
  140. )
  141. ;;
  142. stack)
  143. _command_args=(
  144. '(-a|--all)'{-a,--all}'[include deprecated stacks]' \
  145. )
  146. ;;
  147. esac
  148. _arguments \
  149. $_command_args \
  150. '(--app)--app[the app name]' \
  151. '(--remote)--remote[the remote name]' \
  152. && return 0