TERRAFORM_BIN=$(which-command terraform | head -1)
if [[ -x $TERRAFORM_BIN ]]; then
complete -C $TERRAFORM_BIN terraform
fi