From 3cd13ac90acc50190486c8a6e611d68016f87880 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 24 Dec 2019 17:09:19 -0500 Subject: Exit git-fetch-email on getopt failure --- git-fetch-email.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git-fetch-email.sh') diff --git a/git-fetch-email.sh b/git-fetch-email.sh index 0979a46..704651b 100644 --- a/git-fetch-email.sh +++ b/git-fetch-email.sh @@ -26,7 +26,9 @@ from=$(git config fetchemail.from) to=$(git config fetchemail.to) cc=$(git config fetchemail.cc) -set -- $(getopt 'C:F:S:T:h:m:p:' $*) +args=$(getopt 'C:F:S:T:h:m:p:' $*) +[ $? -ne 0 ] && exit 1 +set -- $args for opt; do shift; case "$opt" in -- cgit 1.4.1