Skip to content

Commit

Permalink
Added support for the CLJ_RLWRAP_CMD env variable and the
Browse files Browse the repository at this point in the history
similar -rlwrap-cmd option so that users can specify their
rlwrap command (and any options)
  • Loading branch information
Russ Olsen committed Oct 2, 2011
1 parent 8e918e6 commit 467509f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions bin/clj
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -56,6 +60,10 @@ add_to_path() {
fi
}

rlwrap_command() {
echo ${CLJ_RLWRAP_CMD:=rlwrap}
}

cygwin=false

# Identify the os we are running under
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 467509f

Please sign in to comment.