From 6017989c4cb1683cc7d454d0f9175022e973ccee Mon Sep 17 00:00:00 2001 From: Alexander Karlis Date: Sat, 12 Sep 2020 00:26:53 -0400 Subject: [PATCH] removed printlns, updated Changelog, updated man --- CHANGELOG.md | 2 ++ assets/manual/bat.1.in | 6 ++++++ src/bin/bat/app.rs | 1 - src/bin/bat/main.rs | 3 --- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 206e4dd5..7ac21cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - Added support for the `NO_COLOR` environment variable, see #1021 and #1031 (@eth-p) - Added `-P` short flag to disable paging, revised man page description, see #1075 and #1082 (@LordFlashmeow) +- Added `--force-colorization` flag & `-f` short flag to provide an alias for forced colorization/decorization, \ +revised man page description, see #1141 (@alexanderkarlis) ## Bugfixes diff --git a/assets/manual/bat.1.in b/assets/manual/bat.1.in index 740d69e4..d4951de7 100644 --- a/assets/manual/bat.1.in +++ b/assets/manual/bat.1.in @@ -87,6 +87,12 @@ Specify when to use the decorations that have been specified via '\-\-style'. Th automatic mode only enables decorations if an interactive terminal is detected. Possible values: *auto*, never, always. .HP +\fB\-f\fR, \fB\-\-force\-colorization\fR +.IP +Alias for '--decorations=always --color=always'. This is useful \ +if the output of bat is piped to another program, but you want \ +to keep the colorization/decorations. +.HP \fB\-\-paging\fR .IP Specify when to use the pager. To disable the pager, use \&'\-\-paging=never' or its alias, diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index 9e4d0f75..b1122f0b 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -288,7 +288,6 @@ impl App { fn style_components(&self) -> Result { let matches = &self.matches; - println!("{:#?}", matches); Ok(StyleComponents( if matches.value_of("decorations") == Some("never") { HashSet::new() diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 373712b3..65129fa7 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -209,7 +209,6 @@ fn run() -> Result { } else { let inputs = vec![Input::ordinary_file(OsStr::new("cache"))]; let config = app.config(&inputs)?; - println!("{:#?}", config); run_controller(inputs, &config) } @@ -218,8 +217,6 @@ fn run() -> Result { let inputs = app.inputs()?; let config = app.config(&inputs)?; - println!("{:#?}", config); - if app.matches.is_present("list-languages") { list_languages(&config)?; Ok(true)