def usage_elems

cli@0.2.0.0 · cli.bend:5263

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

5263# The path, [OPTIONS], required options, need_one groups as E06 writes them,
5264# positionals, then the subcommand slot.
5265def usage_elems(path: String, +items: List<&2, Item>,
5266    +globals: List<&2, Item>) -> List<&2, Segment>:
5267  +args = List.append(&2, Item, items, globals)
5268  +scope = List.append(&2, Item, globals, items)
5269  List.concat(&2, Segment, [
5270    [Segment{path, [Bold{}]}],
5271    options_elem(has_plain_option(args)),
5272    required_options(args),
5273    group_elems(scope, scope, []),
5274    positional_elems(items),
5275    command_elems(has_sub_item(items), needs_sub(items)),
5276  ])

Uses (15)

Used by (5)