Skip to main content

cli_format_output

Function cli_format_output 

Source
pub fn cli_format_output(
    value: Value,
    jsonl: bool,
    json: bool,
    jq: Option<&str>,
) -> Result<String, Box<dyn Error>>
Expand description

Format CLI output according to output flags.

  • jsonl: one JSON object per line for array values
  • json: machine-readable JSON (no whitespace)
  • jq: filter using jaq (jq implemented in Rust, no external binary needed)
  • Default: pretty-printed JSON