cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"

	NoColor bool
	Quiet   bool
	Verbose bool
	NoInput bool
)
View Source
var GetClientFunc = defaultGetClient

GetClientFunc is the function used to create API clients. It can be overridden in tests to inject mock clients.

Functions

func AddJSONFieldsFlag

func AddJSONFieldsFlag(cmd *cobra.Command, target *string)

AddJSONFieldsFlag adds a --json flag that accepts optional field specification

func Execute

func Execute() error

Types

type JSONFieldsResult

type JSONFieldsResult struct {
	Enabled bool
	Fields  []string
}

JSONFieldsResult represents the parsed result of --json flag

func ParseJSONFields

func ParseJSONFields(cmd *cobra.Command, flagValue string, spec *api.FieldSpec) (JSONFieldsResult, bool, error)

ParseJSONFields parses the --json flag value, returns (result, showHelp, error).

type RootCommand

type RootCommand = cobra.Command

RootCommand is an alias for cobra.Command for external access

func GetRootCmd

func GetRootCmd() *RootCommand

GetRootCmd returns the root command for testing

func NewRootCmd

func NewRootCmd() *RootCommand

NewRootCmd creates a fresh root command instance for testing. This ensures tests don't share flag state from previous test runs.

Jump to

Keyboard shortcuts

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