Entry.cmd_of: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/daemon/entry.bend as Entry Lines 151-158 of cswap-bend-cli@0.1.0.0/daemon/entry.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/daemon/entry.bend&start_line=151&end_line=158 import Base import cswap-bend-cli@0.1.0.0/fs.bend as Fs import cswap-bend-cli@0.1.0.0/cmd.bend as Cmd # The verb as a command result: events already went to stdout as they happened, # so only the exit code (and a failure's message) remain. def cmd_of(r: Fs.Res(U32)) -> IO(Cmd.Out): match r: case Done{code}: IO.pure(Cmd.Out, Cmd.Out{code, "", ""}) case Fail{(code, msg)}: IO.pure(Cmd.Out, Cmd.Out{code_for(code), "", msg ++ "\n"}) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 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/daemon/entry.bend&name=code_for https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fs.bend&name=Res