From 4ca5464ca49f6b9582eb750f3a4787fd034bffaf Mon Sep 17 00:00:00 2001 From: Alexander Mironov Date: Fri, 28 Jul 2023 05:44:25 +0300 Subject: [PATCH] Add --force-enable-colors --- src/config/args.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config/args.rs b/src/config/args.rs index fc2c415..2ce6854 100644 --- a/src/config/args.rs +++ b/src/config/args.rs @@ -185,6 +185,10 @@ It's possible to overwrite this behavior by specifying the option") Arg::with_name("disable-colors") .long("disable-colors") ) + .arg( + Arg::with_name("force-enable-colors") + .long("force-enable-colors") + ) .arg( Arg::with_name("disable-trustdns") .long("disable-trustdns") @@ -553,6 +557,11 @@ Increase the amount of workers to remove the error or use --force.")?; colored::control::set_override(false); } + // force enable colors to preseve colors while redirecting output + if args.is_present("force-enable-colors") { + colored::control::set_override(true); + } + // decrease verbose by 1 in case > 1 url is being checked in parallel // this behavior is explained in docs let verbose = if verbose > 0 && !(workers == 1 || urls.len() == 1) {