Skip to main content

Module format

Module format 

Source
Expand description

Shared output-format types for the CLI.

One -o/--output <format> convention is used across the whole CLI surface (issue #1125). This module owns the machine-readable OutputFormat enum and the rendering machinery (write_output/output_as and the JsonlSerialize trait); command modules bind -o/--output to this enum and delegate serialization here, rendering their own Table branch when output_as returns Ok(false).

Atlassian-specific JsonlSerialize impls for its collection wrapper types live in [crate::cli::atlassian::format] (they need the wrapper types); this module carries only the trait, the blanket Vec<T> impl, and the generic helpers.

Enums§

OutputFormat
Display format for list/table commands.
TableOrJson
A two-way -o/--output selector for commands that render either a human-readable table or machine-readable JSON (no YAML/JSONL variants).

Traits§

JsonlSerialize
Writes a value as newline-terminated JSON Lines.

Functions§

output_as
Serializes data in the requested output format to stdout. Returns Ok(true) if data was printed (json/yaml/yamls/jsonl), Ok(false) if the caller should handle table output.
write_items_jsonl
Writes each item in an iterator as a single compact JSON line.
write_output
Writes data to out in the requested format.
write_scalar_jsonl
Writes a single serializable value as one compact JSON line.