Switch.auto2: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/switch.bend as Switch Lines 182-189 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=182&end_line=189 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/swbase.bend as B 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 auto2(+strategy: String, +ctx: SBase.Ctx, +seq: Json.Json, +l: L.Live, +cur: Maybe<&2, String>, +label: String, +models: List<&2, String>, +opts: L.Opts) -> Act.of(Json.Json): match cur: case None{}: Act.pure(Json.Json, B.noop(label, "unmanaged-account", "Active account is not managed; run cswap --add-account", B.ref(None{}, L.lv_email(l)), [])) case Some{c}: Act.cond(Json.Json, Nat.is_lt(List.length(&2, String, B.slots_of(seq)), 2n), Act.pure(Json.Json, B.noop(label, "only-one-account", "Only one account is managed. Add more accounts to switch between.", B.ref(Some{c}, L.lv_email(l)), [])), auto3(strategy, ctx, seq, c, L.lv_email(l), label, models, opts)) 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=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String 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/swbase.bend&name=noop https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swbase.bend&name=ref https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swbase.bend&name=slots_of https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/switch.bend&name=auto3 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swlive.bend&name=Live 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/swlive.bend&name=lv_email