def roff_options

cli@0.2.0.0 · cli.bend:7441

import cli@0.2.0.0/cli.bend as Cli
import Base

7441# The visible options under a heading, "" for OPTIONS.
7442def roff_options(items: List<&2, Item>, +heading: String) -> List<&2, String>:
7443  match items:
7444    case Nil{}: Nil{}
7445    case Arg{+usage, help, +attrs} <> tail:
7446      List.append(&2, String,
7447        roff_option_entry(Bool.and(Bool.not(arg_pos(usage)),
7448          Bool.and(Bool.not(has_hidden(attrs)),
7449            String.eq(find_heading(attrs), heading))), usage, help, attrs),
7450        roff_options(tail, heading))
7451    case head <> tail: roff_options(tail, heading)

Uses (11)

Used by (2)