_heroku 6.3 KB

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