Skip to content

Commit 857a8a2

Browse files
DRY on help text
1 parent d3c9b25 commit 857a8a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/terraform.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ BUILD_DIR="$BASE_DIR/build"
3131
DOCKER_TERRAFORM=$(get_docker_terraform)
3232
DOCKER_LANDSCAPE=$(get_docker_landscape)
3333

34-
verb=${1:?You must specify a verb: plan, plan-destroy, apply, show, output}
34+
HELP_TEXT="You must specify a verb: apply, plan, plan-destroy, import, output or show"
35+
verb=${1:?$HELP_TEXT}
3536

3637
# Inject Google application credentials into env file for docker
3738
GOOGLE_APPLICATION_CREDENTIALS_OVERRIDE=${GOOGLE_APPLICATION_CREDENTIALS_OVERRIDE:-}
@@ -183,7 +184,8 @@ import)
183184
Message="Executing terraform import."
184185
;;
185186
*)
186-
echo 'Unrecognized verb "'"$verb"'" specified. Use apply, plan, plan-destroy, import, output or show' 1>&2
187+
echo 'Unrecognized verb "'"$verb"'" specified.'
188+
echo "$HELP_TEXT" 1>&2
187189
exit 1
188190
;;
189191
esac

0 commit comments

Comments
 (0)