Syntax updates. Finally block in require.
[clojure-patches.git] / clojure
blob08d94efe77f9309eab8132211c46e3d2a473b4fc
1 #!/usr/bin/env sh
3 CLOJURE_HOME=`dirname $0`
4 CLOJURE_JAR=$CLOJURE_HOME/clojure.jar
5 JAVA=`which java`
6 RLWRAP=`which rlwrap`
8 usage () {
9 echo "Usage: `basename $0` [OPTIONS] [-- [ARGUMENTS]]"
10 echo "Runs FILENAME as a script if given, or starts a new interactive session."
11 echo
12 echo "Possible OPTIONs are:"
13 echo " -s FILE Execute script instead of starting the Repl"
14 echo " -d PORT Remote debug mode, listens at PORT"
15 echo " -h, -? This help"
18 while getopts "h?s:d:" OPTION; do
19 case $OPTION in
20 h | \?)
21 usage
22 exit 1;;
24 TARGET="clojure.lang.Script $OPTARG"
25 shift 2;;
27 DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$OPTARG"
28 shift 2;;
30 break;;
31 esac
32 done
34 if [ ! "$TARGET" ]; then
35 TARGET="clojure.lang.Repl"
38 exec $RLWRAP $JAVA $DEBUG -cp $CLOJURE_JAR:$CLASSPATH $TARGET $@