def help_path
import bolt@1.26.0.0/src/args.bend as Argsimport Base
import bolt@1.26.0.0/src/lazy/lazy.bend as Lazy
62# the command path `--help` asks about: the first word other than `--help`,
63# when it names a subcommand, else the root's
64def help_path(ws: List<&2, String>) -> List<&2, String>:
65 match ws:
66 case Nil{}:
67 Nil{}
68 case Con{+ww, rest}:
69 Lazy.either(List<&2, String>, String.eq(ww, "--help"), _u => help_path(rest),
70 _u => Bool.pick(List<&2, String>, is_cmd(ww), [ww], []))