File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ object MainGenericRunner {
72
72
val classpathSeparator = File .pathSeparator
73
73
74
74
@ sharable val javaOption = raw """ -J(.*) """ .r
75
-
75
+ @ sharable val scalaOption = raw """ @.* """ .r
76
+ @ sharable val colorOption = raw """ -color:.* """ .r
76
77
@ tailrec
77
78
def process (args : List [String ], settings : Settings ): Settings = args match
78
79
case Nil =>
@@ -98,12 +99,17 @@ object MainGenericRunner {
98
99
process(tail, settings.withSave)
99
100
case (o @ javaOption(striped)) :: tail =>
100
101
process(tail, settings.withJavaArgs(striped).withScalaArgs(o))
102
+ case (o @ scalaOption(_* )) :: tail =>
103
+ process(tail, settings.withScalaArgs(o))
104
+ case (o @ colorOption(_* )) :: tail =>
105
+ process(tail, settings.withScalaArgs(o))
101
106
case arg :: tail =>
102
107
val line = Try (Source .fromFile(arg).getLines.toList).toOption.flatMap(_.headOption)
103
108
if arg.endsWith(" .scala" ) || arg.endsWith(" .sc" ) || (line.nonEmpty && raw " #!.*scala " .r.matches(line.get)) then
104
109
settings
105
110
.withExecuteMode(ExecuteMode .Script )
106
111
.withTargetScript(arg)
112
+ .withResidualArgs(s " -Dscript.path= $arg" )
107
113
.withScriptArgs(tail* )
108
114
else
109
115
val newSettings = if arg.startsWith(" -" ) then settings else settings.withModeShouldBeRun
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ source "$PROG_HOME/bin/common"
30
30
31
31
# exec here would prevent onExit from being called, leaving terminal in unusable state
32
32
compilerJavaClasspathArgs
33
+ [ -z " ${ConEmuPID-} " -o -n " ${cygwin-} " ] && export MSYSTEM= PWD= # workaround for #12405
33
34
eval " \" $JAVACMD \" " " -classpath \" $jvm_cp_args \" " " dotty.tools.MainGenericRunner" " -classpath \" $jvm_cp_args \" " " $@ "
34
35
scala_exit_status=$?
35
36
You can’t perform that action at this time.
0 commit comments