pub fn apply_output_format(
result: ExecResult,
format: OutputFormat,
) -> ExecResultExpand description
Transform an ExecResult into the requested output format.
Serializes regardless of exit code — commands like diff (exit 1 = files differ)
and grep (exit 1 = no matches) use non-zero exits for semantic meaning,
not errors. The --json contract must hold for all exit codes.