Files
Synapse/cli/lib/output_mode.ml
Dasemu 40631362b3 Initial import of LogDarioSeq baseline
Establishes version control for the personal Logseq DB fork before
starting the server-client architecture migration and domain features
described in docs/agent-guide and the approved implementation plan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 15:32:15 +02:00

19 lines
619 B
OCaml

type t = Output.Mode.packed
let all =
[
Output.Mode.Packed Output.Mode.Human;
Output.Mode.Packed Output.Mode.Json;
Output.Mode.Packed Output.Mode.Edn;
]
let default = Output.Mode.Packed Output.Mode.Human
let of_string = Output.Mode.of_string
let to_string (Output.Mode.Packed mode) = Output.Mode.to_string mode
let structured (Output.Mode.Packed mode) = Output.Mode.structured mode
let merge_preference xs = Vec.find_map (fun x -> x) xs
let for_config config = Option.value config.Cli_config.output_format ~default
let error ?command ?context mode err =
Cli_result.error ?command ?context mode err