scala.tools.nsc.CompilerCommand.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-compiler Show documentation
Show all versions of scala-compiler Show documentation
Compiler for the Scala Programming Language
The newest version!
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.tools.nsc
/** A class representing command line info for scalac */
class CompilerCommand(arguments: List[String], val settings: Settings) {
def this(arguments: List[String], error: String => Unit) = this(arguments, new Settings(error))
def this(arguments: List[String], settings: Settings, error: String => Unit) = this(arguments, settings withErrorFn error)
type Setting = Settings#Setting
private val processArgumentsResult =
if (shouldProcessArguments) processArguments
else (true, Nil)
def ok = processArgumentsResult._1
def files = processArgumentsResult._2
/** The name of the command. */
def cmdName = "scalac"
/** A descriptive alias for version and help messages. */
def cmdDesc = "compiler"
private def explainAdvanced = """
|-- Note --
|Boolean settings generally are false unless set: -Xdev -Xcheck-init:true -Xprompt:false
|Multi-valued settings are comma-separated: -Xlint:infer-any,unused,-missing-interpolator
|Phases are a list of names, ids, or ranges of ids: -Vprint:parser,typer,5-10 -Ylog:-4
|Use _ to enable all: -language:_ -Vprint:_
|
""".stripMargin.trim
def shortUsage = "Usage: %s
© 2015 - 2024 Weber Informatics LLC | Privacy Policy