def help_path

bolt@1.26.0.0 · src/args.bend:62

import bolt@1.26.0.0/src/args.bend as Args
import 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], []))

Uses (6)

Used by (1)