File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ case "$1" in
92
92
-no-colors) unset colors && shift ;;
93
93
-with-compiler) jvm_cp_args=" $PSEP$DOTTY_COMP " && shift ;;
94
94
95
- # break out -D and -J options and add them to JAVA_OPTS as well
96
- # so they reach the JVM in time to do some good. The -D options
95
+ # break out -D and -J options and add them to java_args so
96
+ # they reach the JVM in time to do some good. The -D options
97
97
# will be available as system properties.
98
98
-D* ) addJava " $1 " && shift ;;
99
99
-J* ) addJava " ${1: 2} " && shift ;;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ addJvmOptions () {
31
31
jvm_options+=(" $1 " )
32
32
}
33
33
34
- addRawJvmOptions () {
34
+ addDotcOptions () {
35
35
java_options+=(" $1 " )
36
36
}
37
37
@@ -47,7 +47,8 @@ CLASS_PATH=""
47
47
# Little hack to check if all arguments are options
48
48
all_params=" $* "
49
49
truncated_params=" ${*# -} "
50
- not_only_options=$(( ${# all_params} - ${# truncated_params} - $# ))
50
+ # options_indicator != 0 if at least one parameter is not an option
51
+ options_indicator=$(( ${# all_params} - ${# truncated_params} - $# ))
51
52
52
53
while [[ $# -gt 0 ]]; do
53
54
case " $1 " in
@@ -75,7 +76,7 @@ while [[ $# -gt 0 ]]; do
75
76
;;
76
77
-J* )
77
78
addJvmOptions " ${1: 2} "
78
- addRawJvmOptions " ${1} "
79
+ addDotcOptions " ${1} "
79
80
shift ;;
80
81
* )
81
82
residual_args+=(" $1 " )
@@ -84,7 +85,7 @@ while [[ $# -gt 0 ]]; do
84
85
85
86
esac
86
87
done
87
- if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $not_only_options == 0 ]); then
88
+ if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $options_indicator == 0 ]); then
88
89
if [ " $CLASS_PATH " ]; then
89
90
cp_arg=" -classpath \" $CLASS_PATH \" "
90
91
fi
You can’t perform that action at this time.
0 commit comments