diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-05-28 13:04:24 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-05-28 13:04:24 -0700 |
commit | c8f8782f6a07d1cc3297f22b1798f8e2d562db88 (patch) | |
tree | cecd1abb2edef65270e664c9d81d748dc4b7569e /src/compiler/scala/tools | |
parent | 5551cf66e5b27ae398b527df6fe4247aed1ff307 (diff) | |
download | scala-c8f8782f6a07d1cc3297f22b1798f8e2d562db88.tar.gz scala-c8f8782f6a07d1cc3297f22b1798f8e2d562db88.tar.bz2 scala-c8f8782f6a07d1cc3297f22b1798f8e2d562db88.zip |
SI-8503 Clean up interpolation of help message
We have interpolation now. This commit also moves an extra blank
line from the end to the middle of the message.
Diffstat (limited to 'src/compiler/scala/tools')
-rw-r--r-- | src/compiler/scala/tools/nsc/GenericRunnerCommand.scala | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala b/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala index e710222285..253f18dec6 100644 --- a/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala +++ b/src/compiler/scala/tools/nsc/GenericRunnerCommand.scala @@ -50,17 +50,16 @@ extends CompilerCommand(args, settings) { case Nil => AsRepl case hd :: _ => waysToRun find (_.name == settings.howtorun.value) getOrElse guessHowToRun(hd) } - private def interpolate(s: String) = s.trim.replaceAll("@cmd@", cmdName).replaceAll("@compileCmd@", compCmdName) + "\n" - def shortUsageMsg = interpolate(""" -Usage: @cmd@ <options> [<script|class|object|jar> <arguments>] - or @cmd@ -help + def shortUsageMsg = +s"""|Usage: $cmdName <options> [<script|class|object|jar> <arguments>] + | or $cmdName -help + | + |All options to $compCmdName (see $compCmdName -help) are also allowed. +""".stripMargin -All options to @compileCmd@ (see @compileCmd@ -help) are also allowed. -""") - - override def usageMsg = shortUsageMsg + interpolate(""" -The first given argument other than options to @cmd@ designates + override def usageMsg = f"""$shortUsageMsg +The first given argument other than options to $cmdName designates what to run. Runnable targets are: - a file containing scala source @@ -68,7 +67,7 @@ what to run. Runnable targets are: - a runnable jar file with a valid Main-Class attribute - or if no argument is given, the repl (interactive shell) is started -Options to @cmd@ which reach the java runtime: +Options to $cmdName which reach the java runtime: -Dname=prop passed directly to java to set system properties -J<arg> -J is stripped and <arg> passed to java as-is @@ -86,8 +85,7 @@ A file argument will be run as a scala script unless it contains only self-contained compilation units (classes and objects) and exactly one runnable main method. In that case the file will be compiled and the main method invoked. This provides a bridge between scripts and standard -scala source. - """) + "\n" +scala source.%n""" } object GenericRunnerCommand { |