The 'automagic parseopt' support corrupted non option parameters
that had IFS characters in them. The worst case is when it had
a non option parameter like this:
$1=" * some string"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
exec "$0" -h
}
- parseopt_extra=
- [ -n "$OPTIONS_KEEPDASHDASH" ] &&
- parseopt_extra="$parseopt_extra --keep-dashdash"
-
- eval `echo "$OPTIONS_SPEC" | git rev-parse --parseopt $parseopt_extra -- "$@" || echo exit $?`
+ [ -n "$OPTIONS_KEEPDASHDASH" ] && parseopt_extra="--keep-dashdash"
+ parsed=$(
+ echo "$OPTIONS_SPEC" |
+ git rev-parse --parseopt $parseopt_extra -- "$@"
+ ) &&
+ eval "$parsed" || exit
else
usage() {
die "Usage: $0 $USAGE"