Skip to content

Commit

Permalink
Merge pull request #10123 from som-snytt/dev/814-window-cmd-escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
SethTisue committed Aug 31, 2022
2 parents 7e844a5 + fbd7223 commit af56abc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/CompilerCommand.scala
Expand Up @@ -126,11 +126,11 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
def expandArg(arg: String): List[String] = {
import java.nio.file.{Files, Paths}
import scala.jdk.CollectionConverters._
def stripComment(s: String) = s.takeWhile(_ != '#')
val file = Paths.get(arg stripPrefix "@")
def stripComment(s: String) = s.takeWhile(_ != '#').trim()
val file = Paths.get(arg.stripPrefix("@"))
if (!Files.exists(file))
throw new java.io.FileNotFoundException(s"argument file $file could not be found")
settings.splitParams(Files.readAllLines(file).asScala.map(stripComment).mkString(" "))
Files.readAllLines(file).asScala.map(stripComment).filter(_ != "").toList
}

// override this if you don't want arguments processed here
Expand Down
Expand Up @@ -973,5 +973,5 @@ class MutableSettings(val errorFn: String => Unit, val pathFactory: PathFactory)
}

private object Optionlike {
def unapply(s: String): Boolean = s.startsWith("-")
def unapply(s: String): Boolean = s.startsWith("-") && s != "-"
}

0 comments on commit af56abc

Please sign in to comment.