1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 08:42:08 +00:00

feat: add --quiet-empty CLI flag

This commit is contained in:
dddffgg
2026-01-31 16:41:13 +08:00
parent 626154317f
commit 53a10e0b0a

View File

@@ -643,6 +643,18 @@ pub fn build_app(interactive_output: bool) -> Command {
.hide_short_help(true)
.help("Show diagnostic information for bug reports."),
)
.arg(
Arg::new("quiet-empty")
.long("quiet-empty")
.short('E')
.action(ArgAction::SetTrue)
.help("Produce no output when the input is empty.")
.long_help(
"When this flag is set, bat will produce no output at all when \
the input is empty. This is useful when piping commands that may \
produce empty output, like 'git diff'.",
),
)
.arg(
Arg::new("acknowledgements")
.long("acknowledgements")