def matched.build
import shake@0.7.0.0/src/cli.bend as Cliimport Base
1445# each command's Matched, root first, with the name selected under it
1446def matched.build(lvs: List<&2, Level>, names: List<&2, String>) -> Matched:
1447 match lvs:
1448 case Nil{}:
1449 Leaf{[]}
1450 case Con{hh, tt}:
1451 match names:
1452 case Nil{}:
1453 Leaf{List.reverse(&2, Bind, level.binds(hh))}
1454 case Con{nn, ns}:
1455 Node{List.reverse(&2, Bind, level.binds(hh)), nn, matched.build(tt, ns)}