Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REVERTED: Args files are 1 arg per line, fix -Vprint-args - #10123

Merged
merged 2 commits into from Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 != "-"
}