Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitFailure = 1 ExitCancelled = 2 ExitTimeout = 124 )
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 ¶
AddJSONFieldsFlag adds a --json flag that accepts optional field specification
func RegisterAliases ¶ added in v0.6.0
Types ¶
type ExitError ¶ added in v0.4.0
type ExitError struct {
Code int
}
ExitError is returned by commands that need a specific exit code.
type JSONFieldsResult ¶
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 ¶
RootCommand is an alias for cobra.Command for external access
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. Callers must call RegisterAliases explicitly if alias expansion is needed.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.