diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompilerCommand.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/CompilerCommand.scala | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/compiler/scala/tools/nsc/CompilerCommand.scala b/src/compiler/scala/tools/nsc/CompilerCommand.scala index f1f5130fb8..bab0768ca9 100644 --- a/src/compiler/scala/tools/nsc/CompilerCommand.scala +++ b/src/compiler/scala/tools/nsc/CompilerCommand.scala @@ -27,7 +27,7 @@ class CompilerCommand(arguments: List[String], val settings: Settings) { |-- Notes on option parsing -- |Boolean settings are always false unless set. |Where multiple values are accepted, they should be comma-separated. - | example: -Xplugin:plugin1,plugin2 + | example: -Xplugin:option1,option2 |<phases> means one or a comma-separated list of: | (partial) phase names, phase ids, phase id ranges, or the string "all". | example: -Xprint:all prints all phases. @@ -80,23 +80,23 @@ class CompilerCommand(arguments: List[String], val settings: Settings) { def xusageMsg = createUsageMsg("Possible advanced", shouldExplain = true, _.isAdvanced) def yusageMsg = createUsageMsg("Possible private", shouldExplain = true, _.isPrivate) - // If any of these settings is set, the compiler shouldn't start; - // an informative message of some sort should be printed instead. - def shouldStopWithInfo = { - import settings.{ Setting => _, _ } - Set[BooleanSetting](help, Xhelp, Yhelp, showPlugins, showPhases) exists (_.value) - } + /** For info settings, compiler should just print a message and quit. */ + def shouldStopWithInfo = settings.isInfo def getInfoMessage(global: Global): String = { import settings._ - if (help.value) usageMsg + global.pluginOptionsHelp - else if (Xhelp.value) xusageMsg - else if (Yhelp.value) yusageMsg - else if (showPlugins.value) global.pluginDescriptions - else if (showPhases.value) global.phaseDescriptions + ( - if (debug.value) "\n" + global.phaseFlagDescriptions else "" + if (help) usageMsg + global.pluginOptionsHelp + else if (Xhelp) xusageMsg + else if (Yhelp) yusageMsg + else if (showPlugins) global.pluginDescriptions + else if (showPhases) global.phaseDescriptions + ( + if (debug) "\n" + global.phaseFlagDescriptions else "" ) - else "" + else if (genPhaseGraph.isSetByUser) { + val components = global.phaseNames // global.phaseDescriptors // one initializes + s"Phase graph of ${components.size} components output to ${genPhaseGraph.value}*.dot." + } + else "" } /** |