Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgDisplay added in v0.4.0

func ArgDisplay(a ArgInfo) string

ArgDisplay reconstructs bracket notation for display: <content>, [body], <id|url>...

func Execute

func Execute()

Execute runs the root command.

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd creates the root cobra command.

Types

type ArgInfo added in v0.4.0

type ArgInfo struct {
	Name        string `json:"name"`
	Required    bool   `json:"required"`
	Variadic    bool   `json:"variadic,omitempty"`
	Description string `json:"description"`
	Kind        string `json:"kind"`
}

ArgInfo describes a declared positional argument parsed from a command's Use: string.

func ParseArgs added in v0.4.0

func ParseArgs(cmd *cobra.Command) []ArgInfo

ParseArgs extracts structured arg metadata from a cobra command. Returns the annotation override if arg_schema is set. Returns nil if the command is not runnable (pure group command). Otherwise parses the Use: string after stripping [flags] and [action].

Jump to

Keyboard shortcuts

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