@@ -98,9 +98,6 @@ while [[ $# -gt 0 ]]; do
9898 addScala " $1 "
9999 shift
100100 ;;
101- -d|-debug)
102- DEBUG=" ${DEBUG_STR-} "
103- shift ;;
104101 -version)
105102 # defer to scalac, then exit
106103 shift
@@ -116,8 +113,8 @@ while [[ $# -gt 0 ]]; do
116113 verbose=true
117114 addScala " -verbose"
118115 shift ;;
119- -run|-repl )
120- PROG_NAME= " $ReplMain "
116+ -run)
117+ setExecuteMode ' run '
121118 shift ;;
122119
123120 * )
157154# [ -n "${dump_args}" ] && dumpArgs ; exit 2
158155if [ -z " ${execute_mode-} " ]; then
159156 # no script was specified, set run or repl mode
160- if [[ $options_indicator -eq 0 && " ${residual_args[@]-} " == " " ]]; then
157+ if [[ $options_indicator -eq 0 ]]; then
161158 setExecuteMode ' repl'
162159 else
163160 setExecuteMode ' run'
@@ -179,15 +176,14 @@ script)
179176 else
180177 [[ $save_compiled == true ]] && rm -f $target_jar
181178 PROG_NAME=$ScriptingMain
182- classpathArgs # initialize jvm_cp_args with toolchain classpath
179+ compilerJavaClasspathArgs # initialize jvm_cp_args with toolchain classpath
183180 scripting_string=" -script $target_script ${script_args[@]} "
184181 # use eval instead of exec, to insure that onExit is subsequently called
185182
186183 # $script_cp_arg must be the first argument to $ScriptingMain
187184 # $scripting_string must be last
188185 eval " \" $JAVACMD \" " \
189186 ${JAVA_OPTS:- $default_java_opts } \
190- " ${DEBUG-} " \
191187 " ${java_args[@]} " \
192188 " -classpath \" $jvm_cp_args \" " \
193189 -Dscala.usejavacp=true \
@@ -210,20 +206,20 @@ repl)
210206 ;;
211207
212208run)
213- repl_cparg =" $DOTTY_LIB$PSEP$SCALA_LIB "
209+ run_cparg =" $DOTTY_LIB$PSEP$SCALA_LIB "
214210 if [ -z " $CLASS_PATH " ]; then
215- repl_cparg +=" $PSEP ."
211+ run_cparg +=" $PSEP ."
216212 else
217- repl_cparg +=" $PSEP$CLASS_PATH "
213+ run_cparg +=" $PSEP$CLASS_PATH "
218214 fi
219215 if [ " $class_path_count " -gt 1 ]; then
220216 echo " warning: multiple classpaths are found, scala only use the last one."
221217 fi
222218 if [ $with_compiler == true ]; then
223- repl_cparg +=" $PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR "
219+ run_cparg +=" $PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR "
224220 fi
225221 # exec here would prevent onExit from being called, leaving terminal in unusable state
226- eval " \" $JAVACMD \" " " ${DEBUG-} " " - classpath \" $repl_cparg \" " " ${java_args[@]} " " ${residual_args[@]} "
222+ eval " \" $JAVACMD \" " " - classpath \" $run_cparg \" " " ${java_args[@]} " " ${residual_args[@]} "
227223 scala_exit_status=$?
228224 ;;
229225
0 commit comments