Right now, if -r is passed to tg, an ugly shift error occurs. This patch
checks for that case and outputs the help message if it occurs.
Signed-off-by: martin f. krafft <madduck@debian.org>
Acked-by: Petr Baudis <pasky@suse.cz>
[ -z "$tg__include" ] || return 0
if [ "$1" = "-r" ]; then
- shift; base_remote="$1"; shift
+ shift
+ if [ -z "$1" ]; then
+ echo "Option -r requires an argument." >&2
+ do_help
+ exit 1
+ fi
+ base_remote="$1"; shift
tg="$tg -r $base_remote"
fi