def cmd_of

cswap-bend-cli@0.1.0.0 · daemon/entry.bend:151

import cswap-bend-cli@0.1.0.0/daemon/entry.bend as Entry
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

151# The verb as a command result: events already went to stdout as they happened,
152# so only the exit code (and a failure's message) remain.
153def cmd_of(r: Fs.Res(U32)) -> IO(Cmd.Out):
154  match r:
155    case Done{code}:
156      IO.pure(Cmd.Out, Cmd.Out{code, "", ""})
157    case Fail{(code, msg)}:
158      IO.pure(Cmd.Out, Cmd.Out{code_for(code), "", msg ++ "\n"})

Uses (9)

Used by (1)