
glauber
By: a guest on Nov 11th, 2010 | syntax:
Bash | size: 1.10 KB | hits: 126 | expires: Never
case "$1" in
# Stuff after '-J' in this argument goes to JVM
-J*)
val=${1:2}
if [ "${val:0:4}" = "-Xmx" ]; then
JAVA_MEM=$val
elif [ "${val:0:4}" = "-Xss" ]; then
JAVA_STACK=$val
elif [ "${val}" = "" ]; then
$JAVA_CMD -help
echo "(Prepend -J in front of these options when using 'jruby' command)"
exit
elif [ "${val}" = "-X" ]; then
$JAVA_CMD -X
echo "(Prepend -J in front of these options when using 'jruby' command)"
exit
elif [ "${val}" = "-classpath" ]; then
CP="$CP$CP_DELIMITER$2"
CLASSPATH=""
shift
elif [ "${val}" = "-cp" ]; then
CP="$CP$CP_DELIMITER$2"
CLASSPATH=""
shift
else
if [ "${val:0:3}" = "-ea" ]; then
VERIFY_JRUBY="yes"
elif [ "${val:0:16}" = "-Dfile.encoding=" ]; then
JAVA_ENCODING=$val
fi
java_args=("${java_args[@]}" "${1:2}")
fi
;;