summaryrefslogtreecommitdiff
path: root/devel/jline/files/jython.sh
blob: 5e008d3a2d79671ad8fc6e3fdd90f131f2f96563 (plain) (blame)
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
#!/bin/sh
# Invoke Jython.
# jython.sh,v 1.5 2007/09/28 09:13:55 martin Exp
#
# The path names below are for Jython 2.2 on FreeBSD.
#

CP="/usr/local/lib/jython22/jython.jar"
defs=
wrapper=

case "${JYTHON_CONSOLE:-JLine}" in
    *[Ee]dit[Ll]ine)
	CP="$CP:/usr/local/share/java/classes/libreadline-java.jar"
	defs="-Dpython.console=org.python.util.ReadlineConsole"
	defs="$defs -Dpython.console.readlinelib=Editline"
	;;
    *[Gg]et[Ll]ine)
	CP="$CP:/usr/local/share/java/classes/libreadline-java.jar"
	defs="-Dpython.console=org.python.util.ReadlineConsole"
	defs="$defs -Dpython.console.readlinelib=Getline"
	;;
    *[Jj][Ll]ine)
	CP="$CP:/usr/local/share/java/classes/jline.jar"
	defs="-Dpython.console="
	wrapper=jline.ConsoleRunner
	;;
    *[Rr]ead[Ll]ine)
	CP="$CP:/usr/local/share/java/classes/libreadline-java.jar"
	defs="-Dpython.console=org.python.util.ReadlineConsole"
	defs="$defs -Dpython.console.readlinelib=GnuReadline"
	;;
    *)
	echo >&2 "$0: illegal value of JYTHON_CONSOLE: $JYTHON_CONSOLE"
	exit 64
	;;
esac


if [ -n "$CLASSPATH" ]; then
  CP="$CP:$CLASSPATH"
fi

exec java -Dpython.home="/usr/local/lib/jython22"	\
    -Dpython.cachedir="${HOME}/.jython-cachedir"	\
    -classpath "$CP" $wrapper org.python.util.jython $defs "$@"

#EOF#