def prof_upd

cswap-bend-cli@0.1.0.0 · setimp.bend:221

import cswap-bend-cli@0.1.0.0/setimp.bend as Setimp
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/setload.bend as Setload
import cswap-bend-cli@0.1.0.0/profile.bend as P

221# One profile key, checked as `profile set` checks it; the stored value comes
222# back as the profile file would hold it ("inherit" and null are null).
223def prof_upd(+k: String, u: P.Upd) -> Result<&2, &2, String, Json.Json>:
224  match u:
225    case P.UBad{m}:
226      Fail{m}
227    case P.UOk{p}:
228      Done{or_null(Json.get(k, P.to_json(p, Setload.empty())))}

Uses (8)

Used by (1)