From ee4e09235afa578a7a33267061179ca338e396c0 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 1 Feb 2011 08:27:18 +0000 Subject: Eliminating duplication and trying to outrun ob... Eliminating duplication and trying to outrun obsolescence in the exciting world of fsc. No review. --- src/compiler/scala/tools/nsc/CompilerCommand.scala | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/compiler/scala/tools/nsc/CompilerCommand.scala') diff --git a/src/compiler/scala/tools/nsc/CompilerCommand.scala b/src/compiler/scala/tools/nsc/CompilerCommand.scala index 86579a4e94..2e3bc32007 100644 --- a/src/compiler/scala/tools/nsc/CompilerCommand.scala +++ b/src/compiler/scala/tools/nsc/CompilerCommand.scala @@ -17,17 +17,21 @@ class CompilerCommand(arguments: List[String], val settings: Settings) { /** file extensions of files that the compiler can process */ lazy val fileEndings = Properties.fileEndings + val (ok, files) = + if (shouldProcessArguments) processArguments + else (true, Nil) + /** The name of the command */ def cmdName = "scalac" - private val helpSyntaxColumnWidth: Int = + private def helpSyntaxColumnWidth: Int = (settings.visibleSettings map (_.helpSyntax.length)) max private def format(s: String): String = if (s.length >= helpSyntaxColumnWidth) s else s + (" " * (helpSyntaxColumnWidth - s.length)) - private val explainAdvanced = "\n" + """ + private def explainAdvanced = "\n" + """ |-- Notes on option parsing -- |Boolean settings are always false unless set. |Where multiple values are accepted, they should be comma-separated. @@ -58,11 +62,7 @@ class CompilerCommand(arguments: List[String], val settings: Settings) { } /** Messages explaining usage and options */ - def usageMsg = - if (cmdName == "fsc") - createUsageMsg("where possible standard", false, st => st.isStandard || st.name == "-shutdown") - else - createUsageMsg("where possible standard", false, _.isStandard) + def usageMsg = createUsageMsg("where possible standard", false, _.isStandard) def xusageMsg = createUsageMsg("Possible advanced", true, _.isAdvanced) def yusageMsg = createUsageMsg("Possible private", true, _.isPrivate) @@ -108,8 +108,4 @@ class CompilerCommand(arguments: List[String], val settings: Settings) { settings.processArguments(expandedArguments, true) } - - val (ok, files) = - if (shouldProcessArguments) processArguments - else (true, Nil) } -- cgit v1.2.3