Skip to content

Commit

Permalink
Merge pull request #148 from 01mf02/compact-output
Browse files Browse the repository at this point in the history
Rename `--compact` to `--compact-output`, like in jq.
  • Loading branch information
01mf02 committed Jan 10, 2024
2 parents 7416752 + 6b3e82c commit 1fb444f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jaq/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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<dyn Formatter>` 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)
Expand Down

0 comments on commit 1fb444f

Please sign in to comment.