From a78b5c7699a82252e0bdcd347497cb58a0a67830 Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Wed, 12 Jul 2006 08:38:43 +0000 Subject: tweak the loop over settings, so that bad settings are not tried twice --- src/compiler/scala/tools/nsc/CompilerCommand.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/CompilerCommand.scala b/src/compiler/scala/tools/nsc/CompilerCommand.scala index 4f953ba12b..1678460416 100644 --- a/src/compiler/scala/tools/nsc/CompilerCommand.scala +++ b/src/compiler/scala/tools/nsc/CompilerCommand.scala @@ -47,17 +47,20 @@ class CompilerCommand(arguments: List[String], error: String => unit, interactiv // initialization var args = arguments var ok = true + while (!args.isEmpty && ok) { - val args0 = args if (args.head.startsWith("-")) { if (interactive) { error("no options can be given in interactive mode") ok = false } else { - for (val setting <- settings.allSettings) - args = setting.tryToSet(args); + val args0 = args + for(val setting <- settings.allSettings) + if(args eq args0) + args = setting.tryToSet(args) + if (args eq args0) { - error("unknown option: '" + args.head + "'") + error("bad option: '" + args.head + "'") ok = false } } -- cgit v1.2.3