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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user