aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/config/CompilerCommand.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-15 17:11:19 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-29 08:59:39 +0200
commit6beb1b402f84d4a3f3096a1fca2f71b69fb03c1a (patch)
treea6225111499a16a1c5981f049a14138eba18dcc9 /src/dotty/tools/dotc/config/CompilerCommand.scala
parentde8368d5db436bb126e2f327d58fa1882e427e51 (diff)
downloaddotty-6beb1b402f84d4a3f3096a1fca2f71b69fb03c1a.tar.gz
dotty-6beb1b402f84d4a3f3096a1fca2f71b69fb03c1a.tar.bz2
dotty-6beb1b402f84d4a3f3096a1fca2f71b69fb03c1a.zip
Refactor Driver
- Make parts more reusable - Introduce hook "sourcesRequired" that controls whether no sources on the command line give a help message.
Diffstat (limited to 'src/dotty/tools/dotc/config/CompilerCommand.scala')
-rw-r--r--src/dotty/tools/dotc/config/CompilerCommand.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/config/CompilerCommand.scala b/src/dotty/tools/dotc/config/CompilerCommand.scala
index 3ba8db3ba..e34ca07f9 100644
--- a/src/dotty/tools/dotc/config/CompilerCommand.scala
+++ b/src/dotty/tools/dotc/config/CompilerCommand.scala
@@ -60,7 +60,7 @@ object CompilerCommand extends DotClass {
* are already applied in context.
* @return The list of files to compile.
*/
- def checkUsage(summary: ArgsSummary)(implicit ctx: Context): List[String] = {
+ def checkUsage(summary: ArgsSummary, sourcesRequired: Boolean)(implicit ctx: Context): List[String] = {
val settings = ctx.settings
/** Creates a help message for a subset of options based on cond */
@@ -121,8 +121,7 @@ object CompilerCommand extends DotClass {
ctx.println(infoMessage)
Nil
} else {
- if (summary.arguments.isEmpty && !settings.resident.value)
- ctx.println(usageMessage)
+ if (sourcesRequired && summary.arguments.isEmpty) ctx.println(usageMessage)
summary.arguments
}
}