star

package
v0.1.0-dev.20260923070929 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package star is star's command tree: NewRootCmd builds the root on the shared root of cli.NewRootCmd, attaches the `key` and `docs` commands, and registers every command the bundled Starlark extensions contribute. It is a package rather than part of `main` so the reference generator can walk the tree in-process, as it walks writ's and lore's (#787).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCmd

func NewRootCmd() (*cobra.Command, *extension.Application)

NewRootCmd builds the star command tree on the shared root.

cli.NewRootCmd supplies the persistent flags every program carries, `--dry-run` and `--silent` among them, and the `config`, `man`, `self` and `version` commands. star's own steps at dispatch time wrap the shared pre-run rather than replace it: the shared one builds the narrator and the configuration; then star copies `--dry-run` into extension.DryRun, refreshes the application's flag map from parsed argv, and points the runtime environment's status at the one narrator, so `--silent` gates cli.Note and the starlark ui.note() path alike.

The Application is built after every persistent flag is registered, because it walks the root's flag surface once; the values arrive at dispatch through Refresh. Extension commands load last, so an extension whose command group shares a name with a shared command -- `config` -- attaches beneath it.

Returns:

  • `*cobra.Command`: the root, with every command attached.
  • `*extension.Application`: the session the commands run in; the caller closes it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL