cli

package
v0.0.0-...-ac6e8c9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cli contains the common features used to build CLI applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(cmd *cobra.Command)

func HandleErrors

func HandleErrors(f func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string)

func NewRootCommand

func NewRootCommand(programName, shortDescription string) *cobra.Command

NewRootCommand creates a new root (base) command for a program. The caller is responsible for assigning other properties when needed.

func PrintUserError

func PrintUserError(err error)

Types

type ExitCodeError

type ExitCodeError struct {
	Message  string
	ExitCode int
}

func (ExitCodeError) Error

func (e ExitCodeError) Error() string

Jump to

Keyboard shortcuts

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