def run
cswap-bend-cli@0.1.0.0 · setcmd.bend:278
import cswap-bend-cli@0.1.0.0/setcmd.bend as Setcmd
import Base
import cswap-bend-cli@0.1.0.0/setload.bend as Setload
import cswap-bend-cli@0.1.0.0/cmd.bend as Cmd
278def run(+root: String, p: Plan, json: Bool) -> IO(Cmd.Out):
279 match p:
280 case PList{}:
281 run.list(root, json)
282 case PGet{key}:
283 run.get(root, key, json)
284 case PSet{key, value}:
285 run.set(root, key, value)
286 case PUnset{key}:
287 run.unset(root, key)
288 case PPath{}:
289 IO.pure(Cmd.Out, Cmd.ok(Setload.path(root)))
290 case PBad{msg}:
291 IO.pure(Cmd.Out, Cmd.Out{2, "", "cswap config: error: " ++ msg ++ "\n"})