Skip to content

Commit fead554

Browse files
committed
simplify help message implementation
1 parent 338c529 commit fead554

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

deploy.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
set -o errexit #abort if any command fails
33
me=$(basename "$0")
44

5-
read -r -d '' "help_message" <<EOF || true
6-
5+
help_message="\
76
Deploy generated files to a git branch.
87
98
Usage:
@@ -31,12 +30,7 @@ Variables:
3130
These variables have default values defined in the script. The defaults can be
3231
overridden by environment variables. Any environment variables are overridden
3332
by values set in a '.env' file (if it exists), and in turn by those set in a
34-
file specified by the '--config-file' option.
35-
EOF
36-
37-
print_help() {
38-
printf "%s\n" "$help_message"
39-
}
33+
file specified by the '--config-file' option."
4034

4135
main() {
4236
# Set args from a local environment file.
@@ -50,7 +44,7 @@ main() {
5044
# Parse arg flags
5145
while : ; do
5246
if [[ $1 = "-h" || $1 = "--help" ]]; then
53-
print_help
47+
echo "$help_message"
5448
return 0
5549
elif [[ $1 = "-v" || $1 = "--verbose" ]]; then
5650
verbose=true

0 commit comments

Comments
 (0)