Skip to main content

detect_format

Function detect_format 

Source
pub fn detect_format(
    explicit: Option<OutputFormat>,
    stdout_is_tty: bool,
) -> OutputFormat
Expand description

Resolves the effective output format.

Explicit --format always wins. With no flag, stdout-on-a-tty defaults to markdown; stdout-on-a-pipe defaults to JSONL. Mirrors the design principle that machine consumers (| jq, file redirection) get a stable schema and humans get prose.