From 200924772fa39d5405d868175b9dcf9929f476d4 Mon Sep 17 00:00:00 2001 From: Louis Maddox Date: Fri, 17 Oct 2025 10:18:58 +0100 Subject: [PATCH] docs: amend man page (style modifies cat-like piping) --- assets/manual/bat.1.in | 6 ++++-- doc/long-help.txt | 4 ++-- src/bin/bat/clap_app.rs | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/manual/bat.1.in b/assets/manual/bat.1.in index faa69d53..0be4bb63 100644 --- a/assets/manual/bat.1.in +++ b/assets/manual/bat.1.in @@ -14,7 +14,8 @@ It also communicates with git(1) to show modifications with respect to the git i Whenever the output of {{PROJECT_EXECUTABLE}} goes to a non-interactive terminal, i.e. when the output is piped into another process or into a file, {{PROJECT_EXECUTABLE}} will act as a drop-in -replacement for cat(1) and fall back to printing the plain file contents. +replacement for cat(1) and fall back to printing the plain file contents, +unless an explicit style is requested. .SH "OPTIONS" General remarks: Command-line options like '-l'/'--language' that take values can be specified as @@ -131,7 +132,8 @@ always, *never*. \fB\-\-decorations\fR .IP Specify when to use the decorations that have been specified via '\-\-style'. The -automatic mode only enables decorations if an interactive terminal is detected. Possible +automatic mode only enables decorations if an interactive terminal is detected. The +always mode will show decorations even when piping output. Possible values: *auto*, never, always. .HP \fB\-f\fR, \fB\-\-force\-colorization\fR diff --git a/doc/long-help.txt b/doc/long-help.txt index ac5ded9e..c625ffa3 100644 --- a/doc/long-help.txt +++ b/doc/long-help.txt @@ -87,8 +87,8 @@ Options: --decorations Specify when to use the decorations that have been specified via '--style'. The automatic - mode only enables decorations if an interactive terminal is detected. Possible values: - *auto*, never, always. + mode only enables decorations if an interactive terminal is detected. The always mode will + show decorations even when piping output. Possible values: *auto*, never, always. -f, --force-colorization Alias for '--decorations=always --color=always'. This is useful if the output of bat is diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs index f7e86dbc..3820c284 100644 --- a/src/bin/bat/clap_app.rs +++ b/src/bin/bat/clap_app.rs @@ -299,9 +299,10 @@ pub fn build_app(interactive_output: bool) -> Command { .help("When to show the decorations (*auto*, never, always).") .long_help( "Specify when to use the decorations that have been specified \ - via '--style'. The automatic mode only enables decorations if \ - an interactive terminal is detected. Possible values: *auto*, never, always.", - ), + via '--style'. The automatic mode only enables decorations if \ + an interactive terminal is detected. The always mode will show \ + decorations even when piping output. Possible values: *auto*, never, always.", + ) ) .arg( Arg::new("force-colorization")