Skip to main content

resolve_default_output_format

Function resolve_default_output_format 

Source
pub fn resolve_default_output_format(
    env_override: Option<&str>,
    is_tty: bool,
) -> String
Expand description

Resolves the default output format when the user gave no explicit format.

Precedence here is env-override first, then a TTY policy: an interactive terminal gets human-friendly output, everything else (pipes, files, CI, most agents) gets machine-readable JSON. Pure so it can be unit-tested without a real terminal.