From a5db35def41d10e4e84dc294e55fbfd79ebc8cab Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Fri, 20 May 2016 10:47:53 +0200 Subject: Factor out coloring check to new method `Context#useColors` --- src/dotty/tools/dotc/core/Contexts.scala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index bbe8e920c..68ae0e752 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -370,6 +370,10 @@ object Contexts { /** Is the verbose option set? */ def verbose: Boolean = base.settings.verbose.value + /** Should use colors when printing? */ + def useColors: Boolean = + List("auto", "always") contains base.settings.color.value + /** A condensed context containing essential information of this but * no outer contexts except the initial context. private var _condensed: CondensedContext = null -- cgit v1.2.3 From f594b17ac5b7a05cfca3f7b4b1113c063b974327 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 1 Jun 2016 18:24:00 +0200 Subject: Disable "auto" alternative in `-color` flag --- src/dotty/tools/dotc/config/ScalaSettings.scala | 2 +- src/dotty/tools/dotc/core/Contexts.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala index 54a77eee8..2192e510f 100644 --- a/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -28,7 +28,7 @@ class ScalaSettings extends Settings.SettingGroup { val help = BooleanSetting("-help", "Print a synopsis of standard options") val nowarn = BooleanSetting("-nowarn", "Generate no warnings.") val print = BooleanSetting("-print", "Print program with Scala-specific features removed.") - val color = ChoiceSetting("-color", "mode", "Colored output", List("always", "never", "auto"), "auto") + val color = ChoiceSetting("-color", "mode", "Colored output", List("always", "never"/*, "auto"*/), "always"/* "auto"*/) val target = ChoiceSetting("-target", "target", "Target platform for object files. All JVM 1.5 targets are deprecated.", List("jvm-1.5", "jvm-1.5-fjbg", "jvm-1.5-asm", "jvm-1.6", "jvm-1.7", "jvm-1.8", "msil"), "jvm-1.8") diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 68ae0e752..635f79f59 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -372,7 +372,7 @@ object Contexts { /** Should use colors when printing? */ def useColors: Boolean = - List("auto", "always") contains base.settings.color.value + base.settings.color.value == "always" /** A condensed context containing essential information of this but * no outer contexts except the initial context. -- cgit v1.2.3