def builtin_opts

cli@0.2.0.0 · cli.bend:6388

import cli@0.2.0.0/cli.bend as Cli
import Base

6388# -h and --help, without -h when an arg took it, then at a root with a
6389# version -V and --version likewise.
6390def builtin_opts(+items: List<&2, Item>, globals: List<&2, Item>,
6391    root: Bool) -> List<&2, Opt>:
6392  +args = List.append(&2, Item, items, globals)
6393  flag_opt(Bool.pick(List<&2, String>,
6394      Maybe.is_some(&2, OptFound, find_option(args, "-h")),
6395      ["--help"], ["-h", "--help"]), "Print help") <>
6396    version_opts(Bool.and(root, has_version_item(items)), args)

Uses (14)

Used by (3)