Out.doc_of: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/fmt/out.bend as Out Lines 124-131 of cswap-bend-cli@0.1.0.0/fmt/out.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/fmt/out.bend&start_line=124&end_line=131 import Base import cswap-bend-cli@0.1.0.0/json.bend as Json import cswap-bend-cli@0.1.0.0/cmd.bend as Cmd # The JSON document a command's output stands for: its own JSON when stdout # holds an object or array; else `{schemaVersion, message}` for a success and # `{schemaVersion, error:{type, message}}` for an exit-1 error that went to # stderr; none for a usage error (exit 2). def doc_of(o: Cmd.Out) -> Maybe<&2, Json.Json>: match o: case Cmd.Out{code, +out, err}: doc2(is_doc(Json.parse(out)), Json.parse(out), code, out, err) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/cmd.bend&name=Out https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fmt/out.bend&name=doc2 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fmt/out.bend&name=is_doc https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=parse