Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for the CLJ_RLWRAP_CMD env variable and the

similar -rlwrap-cmd option so that users can specify their
rlwrap command (and any options)
  • Loading branch information...
commit 467509ff9dc7821a05fd360ad636e47aa3b6cd6e 1 parent 8e918e6
Russ Olsen authored
Showing with 17 additions and 2 deletions.
  1. +17 −2 bin/clj
View
19 bin/clj
@@ -8,6 +8,7 @@
# -debug Just print out the java cmd and exit.
# -no-jline Don't use jline
# -rlwrap Turns off jline and tries to use rlwrap
+# -rlwrap-cmd Sets the rlwrap command and any options
# -cp <jar or directory> Add the next argument to the classpath
# -classpath <jar or directory> Add the next argument to the classpath
# -Dname=value Define the given Java system property, passed directly to java.
@@ -33,6 +34,9 @@
# CLJ_USE_RLWRAP - has the same effect as the -rlwrap flag: Turns jline off
# and tries to use rlwrap
#
+# CLJ_RLWRAP_CMD - has the same effect as the -rlwrap-cmd options
+# and tries to use rlwrap
+#
# -----------------------------------------------------------------------------
# $1 is the argument name, and $2 is the number of arguments left.
@@ -56,6 +60,10 @@ add_to_path() {
fi
}
+rlwrap_command() {
+ echo ${CLJ_RLWRAP_CMD:=rlwrap}
+}
+
cygwin=false
# Identify the os we are running under
@@ -128,7 +136,7 @@ if [ -z "$CLJ_USE_RLWRAP" ]; then
RLWRAP_CMD=""
USE_JLINE=true
else
- RLWRAP_CMD=rlwrap
+ RLWRAP_CMD=`rlwrap_command`
USE_JLINE=false
fi
@@ -183,7 +191,14 @@ do
-rlwrap)
USE_JLINE=false
- RLWRAP_CMD=rlwrap
+ RLWRAP_CMD=`rlwrap_command`
+ ;;
+
+ -rlwrap-cmd)
+ arg_check "$1" $#
+ shift
+ CLJ_RLWRAP_CMD="$1"
+ RLWRAP_CMD=`rlwrap_command`
;;
-repl-class)
Please sign in to comment.
Something went wrong with that request. Please try again.