def opt_key

cli@0.2.0.0 · cli.bend:2742

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

2742# name as a key of info; only info's --no- long clears the flag, as in
2743# option_matches.
2744def opt_key(+name: String, info: ArgInfo) -> OptKey:
2745  match info:
2746    case ArgInfo{id, usage, short, +long, +kind, attrs}:
2747      OptKey{name, OptFound{ArgInfo{id, usage, short, long, kind, attrs},
2748        Bool.not(Bool.and(kind_negatable(kind),
2749          Bool.and(Bool.not(String.is_empty(long)),
2750            String.eq(name, negated_long(long)))))}}

Uses (10)

Used by (1)