def switch_to

cswap-bend-cli@0.1.0.0 · switch.bend:63

import cswap-bend-cli@0.1.0.0/switch.bend as Switch
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/swlive.bend as L
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/io.bend as SIo

63# `cswap switch <num|email|alias> [--force]`: the result object of contract 2.3.
64# Already on the target is a no-op (`already-active`) unless `force`, which
65# rewrites the live login from the stored backup (`activated`). After a real
66# switch the live login is re-read once, `opts` later (see verify_live).
67def switch_to(+ctx: SBase.Ctx, +ident: String, +force: Bool, +opts: L.Opts) -> Act.of(Json.Json):
68  do ActM<Json.Json>:
69    m : Maybe<&2, Json.Json> <- SIo.read_seq(SBase.root_of(ctx))
70    direct1(ctx, ident, force, opts, m)

Uses (12)

Used by (3)