Cli.option_matches: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 2586-2600 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=2586&end_line=2600 import Base def option_matches(+query: String, info: ArgInfo) -> Maybe<&2, OptFound>: match info: case ArgInfo{id, usage, +short, +long, +kind, +attrs}: +named = Bool.or( Bool.and(Bool.not(String.is_empty(short)), String.eq(query, short)), Bool.or(Bool.and(Bool.not(String.is_empty(long)), String.eq(query, long)), List.contains(~String, ~String.eq, find_aliases(attrs), query))) +negated = Bool.and(kind_negatable(kind), Bool.and(Bool.not(String.is_empty(long)), String.eq(query, negated_long(long)))) Bool.pick(Maybe<&2, OptFound>, Bool.or(named, negated), Some{OptFound{ArgInfo{id, usage, short, long, kind, attrs}, Bool.not(negated)}}, None{}) Uses (14): 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=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=ArgInfo https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=OptFound https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=find_aliases https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=kind_negatable https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=negated_long