summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompileServer.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-06-06 14:21:06 +0000
committermichelou <michelou@epfl.ch>2007-06-06 14:21:06 +0000
commit83d0d76b1273df16842e76741ac6b9644f79bd7f (patch)
treef814eb8fa3248ae2c1318574b570effc50900bfd /src/compiler/scala/tools/nsc/CompileServer.scala
parentf324c3aa0729eae530092a9953c7a2ac69b5f6f8 (diff)
downloadscala-83d0d76b1273df16842e76741ac6b9644f79bd7f.tar.gz
scala-83d0d76b1273df16842e76741ac6b9644f79bd7f.tar.bz2
scala-83d0d76b1273df16842e76741ac6b9644f79bd7f.zip
splitted usage message
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompileServer.scala')
-rw-r--r--src/compiler/scala/tools/nsc/CompileServer.scala20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/CompileServer.scala b/src/compiler/scala/tools/nsc/CompileServer.scala
index 89620b5687..0d237e2fd9 100644
--- a/src/compiler/scala/tools/nsc/CompileServer.scala
+++ b/src/compiler/scala/tools/nsc/CompileServer.scala
@@ -67,7 +67,7 @@ object CompileServer extends SocketServer {
var reporter: ConsoleReporter = _
- def session(): unit = {
+ def session() {
System.out.println("New session" +
", total memory = "+ runtime.totalMemory() +
", max memory = " + runtime.maxMemory() +
@@ -90,9 +90,10 @@ object CompileServer extends SocketServer {
compiler = null
return
}
- def error(msg: String): unit =
+ def error(msg: String) {
reporter.error(/*new Position*/ FakePos("fsc"),
msg + "\n fsc -help gives more information")
+ }
val command = new CompilerCommand(args, new Settings(error), error, false) {
override val cmdName = "fsc"
settings.disable(settings.prompt)
@@ -106,13 +107,15 @@ object CompileServer extends SocketServer {
reporter = new ConsoleReporter(command.settings, in, out) {
// disable prompts, so that compile server cannot block
- override def displayPrompt = {}
+ override def displayPrompt = ()
}
if (command.settings.version.value)
reporter.info(null, versionMsg, true)
- else if (command.settings.help.value)
- reporter.info(null, command.usageMsg, true)
+ else if (command.settings.help.value || command.settings.Xhelp.value) {
+ if (command.settings.help.value) reporter.info(null, command.usageMsg, true)
+ if (command.settings.Xhelp.value) reporter.info(null, command.xusageMsg, true)
+ }
else if (command.files.isEmpty)
reporter.info(null, command.usageMsg, true)
else {
@@ -153,17 +156,18 @@ object CompileServer extends SocketServer {
}
/** A directory holding redirected output */
- val redirectDir = new File(CompileSocket.tmpDir, "output-redirects")
+ private val redirectDir = new File(CompileSocket.tmpDir, "output-redirects")
redirectDir.mkdirs
- def redirect(setter: PrintStream => unit, filename: String): unit =
+ private def redirect(setter: PrintStream => unit, filename: String) {
setter(
new PrintStream(
new BufferedOutputStream(
new FileOutputStream(
new File(redirectDir, filename)))))
+ }
- def main(args: Array[String]): unit = {
+ def main(args: Array[String]) {
redirect(System.setOut, "scala-compile-server-out.log")
redirect(System.setErr, "scala-compile-server-err.log")
System.err.println("...starting server on socket "+port+"...")