Cli.arg_slots: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 6406-6416 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=6406&end_line=6416 import Base # The positional slots in items, hidden ones too, numbered from k. def arg_slots(items: List<&2, Item>, +k: Nat, +lists: List<&2, List<&2, String>>) -> List<&2, Slot>: match items: case Nil{}: Nil{} case Arg{+usage, help, attrs} <> tail: +parsed = parse_usage(usage) List.append(&2, Slot, pos_slot(parsed, k, usage, attrs, lists), arg_slots(tail, Bool.pick(Nat, usage_kind(~kind_pos, parsed), (k + 1n : Nat), k), lists)) case head <> tail: arg_slots(tail, k, lists) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Item https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Slot https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=kind_pos https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=parse_usage https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=pos_slot https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=usage_kind