chiark / gitweb /
fix indentation
[topgit.git] / tg.sh
diff --git a/tg.sh b/tg.sh
index 9b93f1db17990effa6025b69fc62806c0b718f3f..afdcdda73465812fdf9c260ba10c202aef4515d1 100644 (file)
--- a/tg.sh
+++ b/tg.sh
@@ -261,12 +261,18 @@ setup_hook "pre-commit"
 [ -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
 
 cmd="$1"
-[ -n "$cmd" ] || die "He took a duck in the face at two hundred and fifty knots"
+[ -n "$cmd" ] || { do_help; exit 1; }
 shift
 
 case "$cmd" in