Skip to content

Commit

Permalink
Use rlwrap, where available, for repl (like Leiningen).
Browse files Browse the repository at this point in the history
  • Loading branch information
trptcolin committed Apr 14, 2011
1 parent 2aa8b3e commit 3ffe768
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion script/repl
Expand Up @@ -5,4 +5,21 @@ for f in lib/*.jar; do
CLASSPATH=$CLASSPATH:$f
done

java -Xmx1G -cp $CLASSPATH jline.ConsoleRunner clojure.main -i script/run.clj -r
RLWRAP=`which rlwrap`
if [ ! -x "$RLWRAP" ] || [ "$RLWRAP" = "" ]; then
RLWRAP=""
JLINE=jline.ConsoleRunner
if [ "$OSTYPE" = "cygwin" ]; then
JLINE="-Djline.terminal=jline.UnixTerminal jline.ConsoleRunner"
CYGWIN_JLINE=y
fi
else
JLINE=""
# Test to see if rlwrap supports custom quote chars
rlwrap -m -q '"' echo "hi" > /dev/null 2>&1
if [ $? -eq 0 ]; then
RLWRAP="$RLWRAP -m -q '\"'"
fi
fi

$RLWRAP java -Xmx1G -cp $CLASSPATH $JLINE clojure.main -i script/run.clj -r

0 comments on commit 3ffe768

Please sign in to comment.