File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,8 @@ case "$1" in
95
95
# break out -D and -J options and add them to JAVA_OPTS as well
96
96
# so they reach the JVM in time to do some good. The -D options
97
97
# will be available as system properties.
98
- -D* ) addJava " $1 " && addScala " $1 " && shift ;;
99
- -J* ) addJava " ${1: 2} " && addScala " $1 " && shift ;;
98
+ -D* ) addJava " $1 " && shift ;;
99
+ -J* ) addJava " ${1: 2} " && shift ;;
100
100
* ) addResidual " $1 " && shift ;;
101
101
esac
102
102
done
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ addJvmOptions () {
31
31
jvm_options+=(" $1 " )
32
32
}
33
33
34
+ addRawJvmOptions () {
35
+ java_options+=(" $1 " )
36
+ }
37
+
34
38
source " $PROG_HOME /bin/common"
35
39
36
40
declare -a residual_args
@@ -40,6 +44,11 @@ with_compiler=false
40
44
class_path_count=0
41
45
CLASS_PATH=" "
42
46
47
+ # Little hack to check if all arguments are options
48
+ all_params=" $* "
49
+ truncated_params=" ${*# -} "
50
+ not_only_options=$(( ${# all_params} - ${# truncated_params} - $# ))
51
+
43
52
while [[ $# -gt 0 ]]; do
44
53
case " $1 " in
45
54
-repl)
@@ -65,7 +74,8 @@ while [[ $# -gt 0 ]]; do
65
74
shift
66
75
;;
67
76
-J* )
68
- addJvmOptions " -${1: 2} "
77
+ addJvmOptions " ${1: 2} "
78
+ addRawJvmOptions " ${1} "
69
79
shift ;;
70
80
* )
71
81
residual_args+=(" $1 " )
@@ -74,13 +84,12 @@ while [[ $# -gt 0 ]]; do
74
84
75
85
esac
76
86
done
77
-
78
- if [ $execute_repl == true ] || ([ $execute_run == false ] && [ ${# residual_args[@]} -eq 0 ]); then
87
+ if [ $execute_repl == true ] || ([ $execute_run == false ] && [ $not_only_options == 0 ]); then
79
88
if [ " $CLASS_PATH " ]; then
80
89
cp_arg=" -classpath \" $CLASS_PATH \" "
81
90
fi
82
91
echo " Starting dotty REPL..."
83
- eval " \" $PROG_HOME /bin/dotc\" $cp_arg -repl ${residual_args[@]} "
92
+ eval " \" $PROG_HOME /bin/dotc\" $cp_arg ${java_options[@]} -repl ${residual_args[@]} "
84
93
elif [ $execute_repl == true ] || [ ${# residual_args[@]} -ne 0 ]; then
85
94
cp_arg=" $DOTTY_LIB$PSEP$SCALA_LIB "
86
95
if [ -z " $CLASS_PATH " ]; then
You can’t perform that action at this time.
0 commit comments