def invoke
import cli@0.2.0.0/cli.bend as Cliimport Base
7897# §7.2: what Run.planned writes and exits with, given the host and argv:
7898# Quit's code and text, or plan's run on the value and terminal, mapped by
7899# ran_act. plan builds its output whole, so an action that streams or does
7900# other IO is an act for Run.main instead.
7901def invoke(~A: Type, ~decode: @+m: Matches -> Dec(A),
7902 ~plan: @+t: Term -> A -> Ran, c: Cmd, h: Host,
7903 argv: List<&2, String>) -> Ran:
7904 ran_step(~A, ~plan, eval(~A, ~decode, c, h, argv))