def arg_opts
cli@0.2.0.0 · cli.bend:6364
import cli@0.2.0.0/cli.bend as Cli
import Base
6364
6365def arg_opts(items: List<&2, Item>, +lists: List<&2, List<&2, String>>) ->
6366 List<&2, Opt>:
6367 match items:
6368 case Nil{}: Nil{}
6369 case Arg{+usage, help, +attrs} <> tail:
6370 +rest = arg_opts(tail, lists)
6371 +parsed = parse_usage(usage)
6372 Bool.pick(List<&2, Opt>,
6373 Bool.or(usage_kind(~kind_pos, parsed), has_hidden(attrs)), rest,
6374 arg_opt(parsed, usage, help, attrs, lists) <> rest)
6375 case head <> tail: arg_opts(tail, lists)