Cli.heading_titles: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 5464-5475 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=5464&end_line=5475 import Base # Headings of visible args, in order of first use. def heading_titles(items: List<&2, Item>, +seen: List<&2, String>) -> List<&2, String>: match items: case Nil{}: seen case Arg{usage, help, +attrs} <> tail: +title = find_heading(attrs) heading_titles(tail, Bool.pick(List<&2, String>, Bool.or(String.is_empty(title), Bool.or(has_hidden(attrs), List.contains(~String, ~String.eq, seen, title))), seen, List.append(&2, String, seen, [title]))) case head <> tail: heading_titles(tail, seen) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or 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=List.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty 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=find_heading https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=has_hidden