diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2008-10-15 13:58:23 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2008-10-15 13:58:23 +0000 |
commit | 86b39a89cda0680d487b3591b492e4dc2ed5263f (patch) | |
tree | ee6490ac748ce7c2247f870251db5adb8f9c2d50 /src/compiler/scala/tools/nsc/Main.scala | |
parent | 1615902e57a0d61cebb62409bdc8da0cf1d8bf18 (diff) | |
download | scala-86b39a89cda0680d487b3591b492e4dc2ed5263f.tar.gz scala-86b39a89cda0680d487b3591b492e4dc2ed5263f.tar.bz2 scala-86b39a89cda0680d487b3591b492e4dc2ed5263f.zip |
Fix for #296
The handling of informative messages in CompileServer and in Main was
duplicated, and the two copies slowly diverged over time. The code has
now been refactored, cleaned up, and made more general.
The FakePos(fsc) message was due to a missing override def toString.
Both problems are fixed.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Main.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Main.scala | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/Main.scala b/src/compiler/scala/tools/nsc/Main.scala index a3ff3b7fa3..74e74ae5f8 100644 --- a/src/compiler/scala/tools/nsc/Main.scala +++ b/src/compiler/scala/tools/nsc/Main.scala @@ -60,24 +60,13 @@ object Main extends AnyRef with EvalLoop { return } - if (command.settings.help.value || command.settings.Xhelp.value || command.settings.Yhelp.value) { - if (command.settings.help.value) { - reporter.info(null, command.usageMsg, true) - reporter.info(null, compiler.pluginOptionsHelp, true) - } - if (command.settings.Xhelp.value) - reporter.info(null, command.xusageMsg, true) - if (command.settings.Yhelp.value) - reporter.info(null, command.yusageMsg, true) - } else if (command.settings.showPlugins.value) - reporter.info(null, compiler.pluginDescriptions, true) - else if (command.settings.showPhases.value) - reporter.info(null, compiler.phaseDescriptions, true) - else { + if (command.shouldStopWithInfo) { + reporter.info(null, command.getInfoMessage(compiler), true) + } else { if (command.settings.resident.value) resident(compiler) else if (command.files.isEmpty) { - reporter.info(null, command.usageMsg, true) + reporter.info(null, command.usageMsg, true) reporter.info(null, compiler.pluginOptionsHelp, true) } else { val run = new compiler.Run |