Add heroku alias for setting app or remote name

This commit is contained in:
Remi Remino 2014-01-19 02:31:36 +09:00
commit 6ffbdd1333

View file

@ -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
}