Switch.rotate_out: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/switch.bend as Switch Lines 150-159 of cswap-bend-cli@0.1.0.0/switch.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/switch.bend&start_line=150&end_line=159 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/store.bend as Store import cswap-bend-cli@0.1.0.0/swbase.bend as B import cswap-bend-cli@0.1.0.0/swpick.bend as P 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 def rotate_out(+s: P.Sel, +ctx: SBase.Ctx, +cur: String, +curref: Json.Json, +label: String, +models: List<&2, String>, +opts: L.Opts) -> Act.of(Json.Json): match s: case P.SelOk{slot, warns}: Act.cond(Json.Json, String.eq(slot, cur), Act.pure(Json.Json, B.noop(label, "already-active", "Already on " ++ B.ref_text(curref), curref, warns)), rotate_do(ctx, slot, label, warns, opts)) case P.SelNone{warns, exhausted}: Act.pure(Json.Json, Store.sel.j(exhausted, B.noop(label, "candidates-exhausted", "All other accounts are at their " ++ limits_label(models) ++ " — " ++ stay_msg(cur), curref, warns), B.noop(label, "no-valid-target", "No other accounts have valid stored credentials/config.", curref, warns))) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=cond https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=of https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/act.bend&name=pure https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store/base.bend&name=Ctx https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/store.bend&name=sel.j https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swbase.bend&name=noop https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swbase.bend&name=ref_text https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/switch.bend&name=limits_label https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/switch.bend&name=rotate_do https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/switch.bend&name=stay_msg https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swlive.bend&name=Opts https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swpick.bend&name=Sel