From: Ian Jackson Date: Sun, 22 Nov 2009 15:18:40 +0000 (+0000) Subject: Assume jars are in same directory as jpctb by default X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-owen.git;a=commitdiff_plain;h=afbe2cc2cc040e051ee1f55be352db0bf319a8e1;ds=sidebyside Assume jars are in same directory as jpctb by default --- diff --git a/jpctb b/jpctb index 4446b2d..8b61ed8 100755 --- a/jpctb +++ b/jpctb @@ -32,10 +32,27 @@ fail () { echo >&2 "jpctb: $*" exit 127 } +badusage () { + fail "bad usage: $*" +} -if [ $# -lt 2 ]; then usage; fail 'bad usage'; exit 127; fi +while [ $# -ge 1 ]; do + case "$1" in + -) shift; break;; + --jpctb) + shift + srcjardir="$1" + shift || badusage "--jpctb needs a value" + ;; + -*) badusage "unknown option \`$1'" + ;; + *) + break + esac +done + +if [ $# -lt 1 ]; then usage; badusage "need path to yohoho"; exit 127; fi -srcjardir="$1"; shift yohoho="$1"; shift #---------- find ourselves ---------- @@ -48,6 +65,10 @@ case "$jpctbdir" in *) jpctbdir="$PWD/$jpctbdir" ;; esac +if [ x"$srcjardir" = x ]; then + srcjardir="$jpctbdir" +fi + #---------- find YPP client and the Java installation it uses ---------- yppdir="${yohoho%/*}"