Ezx.dispatch: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/ez/main.bend as Ezx Lines 24-74 of ezx@1.11.0.0/src/ez/main.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/ez/main.bend&start_line=24&end_line=74 import Base import shake@0.6.0.0/main.bend as Shake import ezx@1.11.0.0/src/share/args.bend as Args import ezx@1.11.0.0/src/ez/cmd.bend as Cmd import ezx@1.11.0.0/src/ez/test.bend as Test import ezx@1.11.0.0/src/ez/prove.bend as Prove import ezx@1.11.0.0/src/doctor/run.bend as DoctorRun import ezx@1.11.0.0/src/tool/run.bend as ToolRun import ezx@1.11.0.0/src/tool/world.bend as TW import ezx@1.11.0.0/src/ez/line.bend as L import ezx@1.11.0.0/src/ws/run.bend as WsRun # what a subcommand runs. `L.line` never runs `CHelp`, which names no # command; it is here so the match is whole, and it writes the help a bare # `ez` would. The directories `ez check` and `ez build` write into are made # by those commands once they know they will start bend (`Env.dirs`), so a # refused one leaves the directory as it found it. def dispatch(sub: L.Sub, +matched: Shake.Matched, +as: List<&2, String>) -> IO(Unit): match sub: case L.CInit{}: Cmd.init(L.get(matched, "name"), L.get(matched, "entry"), L.get(matched, "description")) case L.CAdd{}: +target = L.get(matched, "target") +ref = L.get(matched, "ref") +entry = L.get(matched, "entry") +rename = L.get(matched, "rename") WsRun.in.member(_u => Cmd.add(target, ref, entry, rename)) case L.CRemove{}: +name = L.get(matched, "name") WsRun.in.member(_u => Cmd.remove(name)) case L.CLock{}: +up = Shake.on(matched, "upgrade") +only = L.get(matched, "package") WsRun.at.root(_u => Cmd.lock(up, only)) case L.CFetch{}: WsRun.at.root(_u => Cmd.fetch()) case L.CCheck{}: WsRun.in.member(_u => Cmd.check()) case L.CBuild{}: +out = L.get(matched, "out") WsRun.in.member(_u => Cmd.build(out)) case L.CRun{}: WsRun.in.member(_u => Cmd.run(as)) case L.CToolSync{}: ToolRun.sync() case L.CToolRun{}: ToolRun.run(TW.Run{Args.tool.rest(as)}, L.get(matched, "target"), L.get(matched, "entry")) case L.CToolInstall{}: ToolRun.run(TW.Install{}, L.get(matched, "target"), L.get(matched, "entry")) case L.CToolUpgrade{}: ToolRun.run(TW.Upgrade{}, L.get(matched, "target"), L.get(matched, "entry")) case L.CPublish{}: WsRun.in.member(_u => Cmd.publish()) case L.CTest{}: Test.run() case L.CProve{}: Prove.run() case L.CDoctor{}: WsRun.at.root(_u => DoctorRun.run()) case L.CHelp{}: IO.write(Shake.help(L.spec(), [])) Uses (29): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.write 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=Unit https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/doctor/run.bend&name=run https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=add https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=build https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=check https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=fetch https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=init https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=lock https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=publish https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=remove https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/cmd.bend&name=run https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/line.bend&name=Sub https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/line.bend&name=get https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/line.bend&name=spec https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/prove.bend&name=run https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ez/test.bend&name=run https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/share/args.bend&name=tool.rest https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/tool/run.bend&name=run https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/tool/run.bend&name=sync https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/tool/world.bend&name=Act https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/run.bend&name=at.root https://jend.leeeet.dev/definition.txt?path=ezx@1.11.0.0/src/ws/run.bend&name=in.member https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=Matched https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=help https://jend.leeeet.dev/definition.txt?path=shake@0.7.0.0/main.bend&name=on