From 6126f998d1d376f5bf01a228a0dd44453264b9bd Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 29 Oct 2021 16:28:21 -0500 Subject: [PATCH] fix(error): Never show unrequested color If the user prints a raw error, it may include color even if the user turned it off at runtime. Now we'll be more conservative and never show color for raw errors. This is a follow up to #2943; apparently I had missed some cases. --- src/parse/errors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse/errors.rs b/src/parse/errors.rs index 6a90567862d..93b46e51cb6 100644 --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -870,7 +870,7 @@ impl Error { val: String, err: Box, ) -> Self { - Self::value_validation_with_color(arg, val, err, ColorChoice::Auto) + Self::value_validation_with_color(arg, val, err, ColorChoice::Never) } fn value_validation_with_color( @@ -996,7 +996,7 @@ impl Error { } pub(crate) fn argument_not_found_auto(arg: String) -> Self { - let mut c = Colorizer::new(true, ColorChoice::Auto); + let mut c = Colorizer::new(true, ColorChoice::Never); start_error(&mut c, "The argument '"); c.warning(arg.clone());