Skip to main content

Module output

Module output 

Source
Expand description

Unified output abstraction for commands that support both human-readable and JSON output.

Commands construct an Output from their --output format and the global --quiet flag, then route all output through it:

Output adds no buffering of its own: each call writes straight to stdout/stderr as it happens rather than accumulating a buffer to flush at the end, so long-running operations don’t hold their progress back. (The OS may still buffer a redirected or piped stream, as usual.)

Structs§

Output
Wraps the output Format and a Print (carrying --quiet) so commands can emit human-readable and JSON output through a single value.

Enums§

Format
The format a command should render its output in.

Functions§

error_json
Build the canonical JSON error envelope for an error: { "error": { "type": …, "message": … } }.