#! /bin/sh
if [ $# -lt 1 ]; then
## no args, syntax help
	echo "usage: bash launch.sh {Node|CLI|Inspector} {args}"
elif [[ "$1" == -? || "$1" == -help ]]; then
## -?, syntax help
	echo "usage: bash launch.sh {Node|CLI|Inspector} {args}"
elif [ "$1" == Node ]; then
## $1=Node, $2=-port [optional], $3={portno} [mandatory if $2 defined]
## Start TuCSoN node on port 20504 (default) / port {portno}
## -help provide syntax help on arguments
	java -cp TuCSoN-1.9.10.jar alice.tucson.service.TucsonNodeService $2 $3
elif [ "$1" == CLI ]; then
## $1=CLI
## $N=-aid [optional], $N+1={agentid} [mandatory if $N defined]
## $N=-netid [optional], $N+1={ipaddress} [mandatory if $N defined]
## $N=-port [optional], $N+1={portno} [mandatory if $N defined]
## Start TuCSoN Command Line Interpreter on port 20504 (default) / port {portno} with agentid CLI_[localcurrenttime] (default) / agentid {aid} on node localhost (default / node {ipaddress}
## -help provide syntax help on arguments
	java -cp TuCSoN-1.9.10.jar alice.tucson.service.tools.CommandLineInterpreter $2 $3 $4 $5 $6 $7
elif [ "$1" == Inspector ]; then
## Start TuCSoN Inspector
	java -cp TuCSoN-1.9.10.jar alice.tucson.introspection.tools.Inspector
else
	echo "usage: bash launch.sh {Node|CLI|Inspector} {args}"
fi

