def option_rows
cli@0.2.0.0 · cli.bend:5388
import cli@0.2.0.0/cli.bend as Cli
import Base
5388
5389def option_rows(items: List<&2, Item>, +long: Bool, +heading: String) ->
5390 List<&2, Row>:
5391 match items:
5392 case Nil{}: Nil{}
5393 case Arg{+usage, help, +attrs} <> tail:
5394 List.append(&2, Row,
5395 option_row(Bool.and(Bool.not(arg_pos(usage)),
5396 Bool.and(Bool.not(has_hidden(attrs)),
5397 String.eq(find_heading(attrs), heading))),
5398 usage, help, attrs, long),
5399 option_rows(tail, long, heading))
5400 case head <> tail: option_rows(tail, long, heading)