chiark / gitweb /
Copyright and licence info.
[jarrg-ian.git] / jpctb
diff --git a/jpctb b/jpctb
index 24b3268f13ecd19afcc0accf9e054ca6d5743100..1356b396f57657a5ec1868d3fdb7ff26b3dcc947 100755 (executable)
--- a/jpctb
+++ b/jpctb
@@ -24,7 +24,7 @@
 
 
 usage () { cat <<END
-usage: .../jpctb /path/to/dir/with/PCTB*.jar /path/to/yohoho/yohoho [...]
+usage: .../jpctb /path/to/yohoho/yohoho [...]
 END
 }
 
@@ -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%/*}"
@@ -80,13 +101,17 @@ jpctb:
    jpctb tmpdir: "$jtmp"
 END
 
+#---------- run the control panel ----------
+
+"$javadir/bin/java" -jar "$srcjardir/PCTB-ControlPanel.jar"
+
 #---------- create the temporary are and link farm ----------
 
 rm -rf -- "$jtmp"
 mkdir -- "$jtmp" "$extdir" "$linkfarm"
 cp "$srcjardir"/PCTB*.jar "$extdir"
 
-lndir -silent "$javadir" "$linkfarm"
+cp -Rs "$javadir"/. "$linkfarm"/.
 
 #---------- edit the linkfarm to have our jvm wrapper ----------