diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku index 46663303a..36c6b0bba 100644 --- a/plugins/heroku/_heroku +++ b/plugins/heroku/_heroku @@ -159,3 +159,23 @@ _arguments \ '(--remote)--remote[the remote name]' \ && return 0 +# Alias overriding default "heroku" command to ease setting app or remote name. +# +# heroku @@foo info -> heroku info -a foo +# heroku @foo info -> heroku info -r foo + +heroku() { + if [ $# -gt 0 ] && [ ${1:0:2} = "@@" ] + then + app=${1:2} + shift + command heroku $@ -a $app + elif [ $# -gt 0 ] && [ ${1:0:1} = "@" ] + then + remote=${1:1} + shift + command heroku $@ -r $remote + else + command heroku $@ + fi +}