def code
import ezx@1.11.0.0/src/tool/plan.bend as Planimport Base
1321# the status a tool command exits with, given the status the program it
1322# started exited with (EZ-OUT-1): 1 for a refusal, 0 for a command that
1323# ends without starting one, and the program's own status for `ez tool run`.
1324# A command that starts nothing is handed 0 for it.
1325def code(ended: Exit, program: U32) -> U32:
1326 match ended:
1327 case Refusal{}:
1328 1
1329 case Finished{}:
1330 0
1331 case Exits{_b, _as}:
1332 program