1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-09 19:51:48 +00:00

Add --strip-ansi option

This commit is contained in:
Ethan P.
2024-06-10 21:05:20 -07:00
parent c264ecd26b
commit 70ff93d238
8 changed files with 155 additions and 1 deletions
+10
View File
@@ -7,6 +7,7 @@ use crate::{
clap_app,
config::{get_args_from_config_file, get_args_from_env_opts_var, get_args_from_env_vars},
};
use bat::StripAnsiMode;
use clap::ArgMatches;
use console::Term;
@@ -242,6 +243,15 @@ impl App {
4
},
),
strip_ansi: match self
.matches
.get_one::<String>("strip-ansi")
.map(|s| s.as_str())
{
Some("never") => StripAnsiMode::Never,
Some("always") => StripAnsiMode::Always,
_ => unreachable!("other values for --strip-ansi are not allowed"),
},
theme: self
.matches
.get_one::<String>("theme")