on master help sign in
removed printlns, updated Changelog, updated man
6017989Alexander Karlis
CHANGELOG.md+2
@@ -4,6 +4,8 @@
4
4
5- Added support for the `NO_COLOR` environment variable, see #1021 and #1031 (@eth-p)
5- Added support for the `NO_COLOR` environment variable, see #1021 and #1031 (@eth-p)
6- Added `-P` short flag to disable paging, revised man page description, see #1075 and #1082 (@LordFlashmeow)
6- Added `-P` short flag to disable paging, revised man page description, see #1075 and #1082 (@LordFlashmeow)
7+- Added `--force-colorization` flag & `-f` short flag to provide an alias for forced colorization/decorization, \
8+revised man page description, see #1141 (@alexanderkarlis)
7
9
8## Bugfixes
10## Bugfixes
9
11
assets/manual/bat.1.in+6
@@ -87,6 +87,12 @@ Specify when to use the decorations that have been specified via '\-\-style'. Th
87automatic mode only enables decorations if an interactive terminal is detected. Possible
87automatic mode only enables decorations if an interactive terminal is detected. Possible
88values: *auto*, never, always.
88values: *auto*, never, always.
89.HP
89.HP
90+\fB\-f\fR, \fB\-\-force\-colorization\fR
91+.IP
92+Alias for '--decorations=always --color=always'. This is useful \
93+if the output of bat is piped to another program, but you want \
94+to keep the colorization/decorations.
95+.HP
90\fB\-\-paging\fR <when>
96\fB\-\-paging\fR <when>
91.IP
97.IP
92Specify when to use the pager. To disable the pager, use \&'\-\-paging=never' or its alias,
98Specify when to use the pager. To disable the pager, use \&'\-\-paging=never' or its alias,
src/bin/bat/app.rs−1
@@ -288,7 +288,6 @@ impl App {
288
288
289 fn style_components(&self) -> Result<StyleComponents> {
289 fn style_components(&self) -> Result<StyleComponents> {
290 let matches = &self.matches;
290 let matches = &self.matches;
291− println!("{:#?}", matches);
292 Ok(StyleComponents(
291 Ok(StyleComponents(
293 if matches.value_of("decorations") == Some("never") {
292 if matches.value_of("decorations") == Some("never") {
294 HashSet::new()
293 HashSet::new()
src/bin/bat/main.rs−3
@@ -209,7 +209,6 @@ fn run() -> Result<bool> {
209 } else {
209 } else {
210 let inputs = vec![Input::ordinary_file(OsStr::new("cache"))];
210 let inputs = vec![Input::ordinary_file(OsStr::new("cache"))];
211 let config = app.config(&inputs)?;
211 let config = app.config(&inputs)?;
212− println!("{:#?}", config);
213
212
214 run_controller(inputs, &config)
213 run_controller(inputs, &config)
215 }
214 }
@@ -218,8 +217,6 @@ fn run() -> Result<bool> {
218 let inputs = app.inputs()?;
217 let inputs = app.inputs()?;
219 let config = app.config(&inputs)?;
218 let config = app.config(&inputs)?;
220
219
221− println!("{:#?}", config);
222−
223 if app.matches.is_present("list-languages") {
220 if app.matches.is_present("list-languages") {
224 list_languages(&config)?;
221 list_languages(&config)?;
225 Ok(true)
222 Ok(true)