Cli.global_go: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 2554-2573 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=2554&end_line=2573 import Base # What items pass down to their subcommands, in their order: each global() # arg, and each exclusive or need_one rule over a group whose args in all are # each global(), so that it holds in every subcommand below. def global_go(items: List<&2, Item>, +all: List<&2, Item>) -> List<&2, Item>: match items: case Nil{}: Nil{} case Arg{usage, help, +attrs} <> tail: +rest = global_go(tail, all) Bool.pick(List<&2, Item>, has_global(attrs), Arg{usage, help, attrs} <> rest, rest) case Exclusive{+name} <> tail: +rest = global_go(tail, all) Bool.pick(List<&2, Item>, group_global(all, name), Exclusive{name} <> rest, rest) case NeedOne{+name} <> tail: +rest = global_go(tail, all) Bool.pick(List<&2, Item>, group_global(all, name), NeedOne{name} <> rest, rest) case head <> tail: global_go(tail, all) Uses (5): 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 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=group_global https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=has_global