cmd

package
v0.0.0-...-c95c8ef Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 55 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmd is the Cobra command tree. Root wires the global flags, the help groups (Workload / Management), and hands every subcommand an *app.App through the context.

Index

Constants

View Source
const (
	GroupAuth       = "auth"
	GroupWorkload   = "workload"
	GroupManagement = "management"
	GroupOther      = "other"
)

Help group ids.

Variables

This section is empty.

Functions

func Execute

func Execute() int

Execute runs the tree and maps the error to an exit code.

func FromContext

func FromContext(ctx context.Context) *app.App

FromContext returns the App the root PersistentPreRunE installed.

func LoadError

func LoadError(ctx context.Context) error

LoadError returns why the root could not build the App for a command marked with annotationRunsWithoutConfig (nil when it could).

func NewRoot

func NewRoot(stdout, stderr io.Writer) *cobra.Command

NewRoot builds the command tree. Global flags bind to a fresh Globals per root so tests (and embedders) never share flag state across roots.

func Register

func Register(f func() *cobra.Command)

Register adds a family constructor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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