From bd9c134e076f7ddc8c21663af2e9f5d995dd5462 Mon Sep 17 00:00:00 2001 From: reynir Date: Mon, 28 Nov 2022 14:27:49 +0000 Subject: [PATCH] deploy.sh: print usage message (#130) Co-authored-by: reynir Co-committed-by: reynir --- deploy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 72d00f76..9f41a333 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,13 @@ #!/bin/sh +usage () { + { + echo "Usage: $0 [--vagrant]" + echo "Usage: $0 [--vagrant] base" + echo "Usage: $0 [--vagrant] services [SERVICE]" + } >&2 +} + BASE_CMD="ansible-playbook playbook.yml --ask-vault-pass" if [ "$1" = "--vagrant" ]; then @@ -30,7 +38,7 @@ else $BASE_CMD --tags base_only ;; *) - echo >&2 "Command \"$1\" not found!" + usage exit 1 ;; esac