Cli.want_verdict: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 4494-4523 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=4494&end_line=4523 import Base # The first Q-static message for an arg in scope: kind, absence, then keys, # or for a program, then rest(). def want_verdict(want: Want, +id: String, +kind: UsageKind, +attrs: List<&2, Item>) -> Maybe<&2, String>: match want: case WFlag{}: kind_verdict(kind_flag(kind), id, kind, attrs) case WCount{}: kind_verdict(kind_count(kind), id, kind, attrs) case WValue{+stem, +form}: Maybe.or(&2, String, kind_verdict(value_fits(stem, form, kind, attrs), id, kind, attrs), absent_verdict(Bool.and(form_one(form), may_absent(kind, attrs)), id, stem)) case WAny{}: None{} case WChoose{opt, keys}: Maybe.or(&2, String, kind_verdict(choose_fits(kind, attrs), id, kind, attrs), Maybe.or(&2, String, absent_verdict(Bool.and(Bool.not(opt), may_absent(kind, attrs)), id, "choose"), keys_verdict(find_one_of(attrs), keys, id))) case WProgram{opt}: Maybe.or(&2, String, kind_verdict(program_fits(kind, attrs), id, kind, attrs), Maybe.or(&2, String, absent_verdict(Bool.and(Bool.not(opt), Bool.not(always_present(kind, attrs))), id, "program"), rest_verdict(has_rest(attrs), id))) Uses (23): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Item https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=UsageKind https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Want https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=absent_verdict https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=always_present https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=choose_fits https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=find_one_of https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=form_one https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=has_rest https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=keys_verdict https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=kind_count https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=kind_flag https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=kind_verdict https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=may_absent https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=program_fits https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=rest_verdict https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=value_fits