-
Notifications
You must be signed in to change notification settings - Fork 63
/
nanos.in
50 lines (42 loc) · 1.22 KB
/
nanos.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
DEBUG=n
SUSPEND=n
DEBUG_PORT=8000
TEST=0
usage() {
echo "Usage: nanos [OPTIONS] [NANOS_OPTIONS]"
echo ""
echo "Options:"
echo " -d Enable JPDA debugging"
echo " -s When debugging is enabled, start with application suspended."
echo " -a PORT Listen on PORT for debugger connections, default 8000"
echo " -j JAR1:JAR2 Additional jars to add to the classpath."
echo " -t Runs tests."
echo ""
echo "Nanos Options:"
# TODO: Let nanos output these itself.
echo ""
echo " --datadir DATADIR Look for data files in DATADIR rather than current"
echo " working directory."
echo ""
}
while getopts ":da:shj:t" opt; do
case $opt in
d) DEBUG=y ;;
s) SUSPEND=y ;;
a) DEBUG_PORT=$OPTARG ;;
j) EXTRA_CP=":$OPTARG" ;;
h) usage ; exit 0 ;;
t) TEST=1 ;;
?) break ;;
esac
done
DEBUG_ARGS=
if test "$DEBUG" = y; then
DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=${SUSPEND},address=${DEBUG_PORT}"
fi
if test "$TEST" = 1; then
DEBUG_ARGS="${DEBUG_ARGS} -Dfoam.main=testRunnerScript"
fi
shift $(($OPTIND - 1))
exec java $DEBUG_ARGS -Dnanos.webroot="$PWD" -cp @CLASSPATH@$EXTRA_CP foam.nanos.boot.Boot "$@"