@@ -116,8 +116,8 @@ while [[ $# -gt 0 ]]; do
116116 verbose=true
117117 addScala " -verbose"
118118 shift ;;
119- -run|-repl )
120- PROG_NAME= " $ReplMain "
119+ -run)
120+ setExecuteMode ' run '
121121 shift ;;
122122
123123 * )
157157# [ -n "${dump_args}" ] && dumpArgs ; exit 2
158158if [ -z " ${execute_mode-} " ]; then
159159 # no script was specified, set run or repl mode
160- if [[ $options_indicator -eq 0 && " ${residual_args[@]-} " == " " ]]; then
160+ if [[ $options_indicator -eq 0 ]]; then
161161 setExecuteMode ' repl'
162162 else
163163 setExecuteMode ' run'
@@ -179,7 +179,7 @@ script)
179179 else
180180 [[ $save_compiled == true ]] && rm -f $target_jar
181181 PROG_NAME=$ScriptingMain
182- classpathArgs # initialize jvm_cp_args with toolchain classpath
182+ compilerJavaClasspathArgs # initialize jvm_cp_args with toolchain classpath
183183 scripting_string=" -script $target_script ${script_args[@]} "
184184 # use eval instead of exec, to insure that onExit is subsequently called
185185
@@ -210,20 +210,20 @@ repl)
210210 ;;
211211
212212run)
213- repl_cparg =" $DOTTY_LIB$PSEP$SCALA_LIB "
213+ run_cparg =" $DOTTY_LIB$PSEP$SCALA_LIB "
214214 if [ -z " $CLASS_PATH " ]; then
215- repl_cparg +=" $PSEP ."
215+ run_cparg +=" $PSEP ."
216216 else
217- repl_cparg +=" $PSEP$CLASS_PATH "
217+ run_cparg +=" $PSEP$CLASS_PATH "
218218 fi
219219 if [ " $class_path_count " -gt 1 ]; then
220220 echo " warning: multiple classpaths are found, scala only use the last one."
221221 fi
222222 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 "
223+ run_cparg +=" $PSEP$DOTTY_COMP$PSEP$TASTY_CORE$PSEP$DOTTY_INTF$PSEP$SCALA_ASM$PSEP$DOTTY_STAGING$PSEP$DOTTY_TASTY_INSPECTOR "
224224 fi
225225 # exec here would prevent onExit from being called, leaving terminal in unusable state
226- eval " \" $JAVACMD \" " " ${DEBUG-} " " -classpath \" $repl_cparg \" " " ${java_args[@]} " " ${residual_args[@]} "
226+ eval " \" $JAVACMD \" " " ${DEBUG-} " " -classpath \" $run_cparg \" " " ${java_args[@]} " " ${residual_args[@]} "
227227 scala_exit_status=$?
228228 ;;
229229
0 commit comments