X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=tg.sh;h=313c5b5f9f9a545e5b35000dddaa17e559d971ca;hb=50c4d01dc14c1be93d08c319e277c5227595d8c3;hp=2961106f735402d695043f31b32ffdef298566b3;hpb=7db67d6925f059972cda19645eb5e245e37187d7;p=topgit.git diff --git a/tg.sh b/tg.sh index 2961106..313c5b5 100644 --- a/tg.sh +++ b/tg.sh @@ -236,6 +236,11 @@ do_help() } +## Startup + +[ -d "@cmddir@" ] || + die "No command directory: '@cmddir@'" + ## Initial setup set -e @@ -249,9 +254,6 @@ tg="tg" setup_ours setup_hook "pre-commit" -[ -d "@cmddir@" ] || - die "No command directory: '@cmddir@'" - ## Dispatch # We were sourced from another script for our utility functions; @@ -264,13 +266,13 @@ if [ "$1" = "-r" ]; then 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 help|--help|-h) do_help "$1" - exit 1;; + exit 0;; --hooks-path) # Internal command echo "@hooksdir@";; @@ -281,3 +283,5 @@ help|--help|-h) } . "@cmddir@"/tg-$cmd;; esac + +# vim:noet