Skip to content

Instantly share code, notes, and snippets.

@oscarcck
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarcck/9596840 to your computer and use it in GitHub Desktop.
Save oscarcck/9596840 to your computer and use it in GitHub Desktop.
#compdef ey
#autoload
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Engineyard (https://github.com/engineyard/engineyard).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Leo Critchley (https://github.com/ljfc)
#
# ------------------------------------------------------------------------------
# -*- 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=(
'deploy:Deploy specified branch, tag, or sha to specified environment.'
'environments:List environments for this app; use --all to list all environments.'
'logs:Retrieve the latest logs for an environment.'
'rebuild:Rebuild specified environment.'
'rollback:Rollback to the previous deploy.'
'status:Show the deployment status of the app'
'recipes apply:Run chef recipes uploaded by "ey recipes upload" on the specified ...'
'recipes upload:Upload custom chef recipes to specified environment so they can be...'
'recipes download:Download a copy of the custom chef recipes from this environment i...'
'web enable:Remove the maintenance page for this application in the given envi...'
'web disable:Put up the maintenance page for this application in the given envi...'
'ssh:Open an ssh session to the master app server, or run a command.'
'launch:Open application in browser.'
'whoami:Who am I logged in as?'
'login:Log in and verify access to EY Cloud.'
'logout:Remove the current API key from ~/.eyrc or env variable $EYRC'
)
_ey_help_arguments() {
help_arguments=(
deploy
environments
logs
rebuild
rollback
status
recipes apply
recipes upload
recipes download
web enable
web disable
web restart
init
timeout_deploy
servers
ssh
launch
whoami
login
logout
)
}
_arguments \
'(--version)--version[ey version]' \
'(--help)--help[ey command help]' \
'*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "ey subcommand" _1st_arguments
return
fi
case "$words[1]" in
h|help)
_ey_help_arguments
_wanted help_arguments expl 'all help' compadd -a help_arguments ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment