cmd

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleExecuteError added in v0.60.7

func HandleExecuteError(ch *cmdutil.Helper, err error) int

HandleExecuteError handles an error returned by RootCmd, returning the desired exit code. It contains user-friendly handling for common errors. NOTE (2025-03-27): This is a workaround for Cobra not supporting custom logic for printing the error from RunE.

func RootCmd added in v0.60.7

func RootCmd(ch *cmdutil.Helper) *cobra.Command

RootCmd creates the root command and adds all subcommands.

func Run added in v0.60.7

func Run(ctx context.Context, ver cmdutil.Version)

Run initializes the root command and executes it. It also handles errors and prints them in a user-friendly way. NOTE: If you change this function, also check if you need to update testcli.Fixture.Run.

Types

This section is empty.

Jump to

Keyboard shortcuts

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