From 6b3e82c891b74c8b8afb2ad44ae7765c4d5dfa4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20F=C3=A4rber?= <01mf02@gmail.com> Date: Wed, 10 Jan 2024 10:09:29 +0100 Subject: [PATCH] Rename `--compact` to `--compact-output`, like in jq. --- jaq/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jaq/src/main.rs b/jaq/src/main.rs index dbe94eafe..e4d1a86ff 100644 --- a/jaq/src/main.rs +++ b/jaq/src/main.rs @@ -53,7 +53,7 @@ struct Cli { /// Print JSON compactly, omitting whitespace #[arg(short, long)] - compact: bool, + compact_output: bool, /// Do not print a newline after each value /// @@ -444,7 +444,7 @@ fn print(cli: &Cli, val: Val, writer: &mut impl Write) -> io::Result<()> { // this looks ugly, but it is hard to abstract over the `Formatter` because // we cannot create a `Box` because // Rust says that the `Formatter` trait is not "object safe" - if cli.compact { + if cli.compact_output { ColoredFormatter::new(CompactFormatter).write_colored_json(&val, writer, mode) } else { ColoredFormatter::new(PrettyFormatter::new()).write_colored_json(&val, writer, mode)