Exec.dispatch: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/exec.bend as Exec Lines 131-148 of cswap-bend-cli@0.1.0.0/exec.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/exec.bend&start_line=131&end_line=148 import Base import cswap-bend-cli@0.1.0.0/cliops.bend as Cliops import cswap-bend-cli@0.1.0.0/cmd.bend as Cmd import cswap-bend-cli@0.1.0.0/args.bend as Args import cswap-bend-cli@0.1.0.0/tui/run.bend as Tui import cswap-bend-cli@0.1.0.0/daemon/entry.bend as Entry import cswap-bend-cli@0.1.0.0/clibase.bend as Clibase # One case per command family; a command that arrives later (auto) is one more # case here and one more entry in Args.build.cmd. def dispatch(+ni: Cliops.Ni, +p: Args.Parsed) -> IO(Cmd.Out): match p: case Args.PHelp{}: IO.pure(Cmd.Out, Cmd.Out{0, help_text(), ""}) case Args.PVersion{}: IO.pure(Cmd.Out, Cmd.ok(Clibase.version())) case Args.PBad{msg}: IO.pure(Cmd.Out, Cmd.Out{2, "", msg ++ "\n"}) case Args.PTui{ts}: IO.bind(Unit, Cmd.Out, Tui.main(Clibase.affine(ts), Clibase.version()), u => IO.pure(Cmd.Out, Cmd.silent())) case Args.PAuto{ts}: Entry.auto_cmd(ts, Clibase.version()) case Args.PConfig{ts, json}: with_ctx(ctx => config_cmd(ctx, ts, json, ni)) case _: other_cmd(ni, p) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/args.bend&name=Parsed https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/clibase.bend&name=affine https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/clibase.bend&name=version https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/cliops.bend&name=Ni https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/cmd.bend&name=Out https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/cmd.bend&name=ok https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/cmd.bend&name=silent https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/daemon/entry.bend&name=auto_cmd https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/exec.bend&name=config_cmd https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/exec.bend&name=help_text https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/exec.bend&name=other_cmd https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/exec.bend&name=with_ctx https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/tui/run.bend&name=main