def display_choices

cli@0.2.0.0 · cli.bend:5889

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

5889# T4 for E04: the one_of values of the arg E04 names.
5890def display_choices(items: List<&2, Item>, +arg: String,
5891    found: List<&2, String>) -> List<&2, String>:
5892  match items found:
5893    case _ head <> tail: head <> tail
5894    case Nil{} Nil{}: Nil{}
5895    case Arg{usage, help, +attrs} <> tail Nil{}:
5896      display_choices(tail, arg, Bool.pick(List<&2, String>,
5897        String.eq(arg_display(arg_info(usage, attrs)), arg),
5898        list_or_none(find_one_of(attrs)), []))
5899    case head <> tail Nil{}: display_choices(tail, arg, [])

Uses (9)

Used by (1)