Rpcmsg.opt_flag: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/rpcmsg.bend as Rpcmsg Lines 69-82 of cswap-bend-cli@0.1.0.0/rpcmsg.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/rpcmsg.bend&start_line=69&end_line=82 import Base import cswap-bend-cli@0.1.0.0/json.bend as Json def opt_flag(+k: String, +v: Json.Json) -> Result<&2, &2, String, List<&2, String>>: match v: case Json.JBool{True{}}: Done{[dashes(k)]} case Json.JBool{False{}}: Done{[]} case Json.JNull{}: Done{[]} case Json.JStr{s}: Done{[dashes(k), s]} case Json.JNum{t}: Done{[dashes(k), t]} case _: Fail{"option '" ++ k ++ "' must be a string, a number or a boolean"} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append 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/rpcmsg.bend&name=dashes