summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-04-27 11:55:43 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-04-27 11:55:43 +0200
commit3b261418918c09128f737f315842edd5ec30bff2 (patch)
tree1674ec5bc6e44665f0db3a9104d3296d2b4f7bcd
parentf36468e24d812cd9cb338fb4224cf7fdb750c232 (diff)
downloadubergit-3b261418918c09128f737f315842edd5ec30bff2.tar.gz
ubergit-3b261418918c09128f737f315842edd5ec30bff2.tar.xz
fix option parsing to properly fail when git-rev-parse fails
Running eval "$(false || exit 1)" doesn't exit the calling shell. For that to work the exit command needs to be echoed. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--uglib.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/uglib.sh b/uglib.sh
index faf8d93..668b101 100644
--- a/uglib.sh
+++ b/uglib.sh
@@ -207,5 +207,5 @@ sq() {
## option parsing ## {{{1
if test -n "$UG_OPTIONS_SPEC"; then
- eval "$(printf "%s\n" "$UG_OPTIONS_SPEC" | git rev-parse --parseopt --keep-dashdash --stop-at-non-option -- "$@" || exit "$?")"
+ eval "$(printf "%s\n" "$UG_OPTIONS_SPEC" | git rev-parse --parseopt --keep-dashdash --stop-at-non-option -- "$@" || echo "exit '$?'")"
fi