cmd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExitSuccess when everything goes to plan.
	ExitSuccess = iota

	// ExitUnknown if the cause of the error is not defined.
	ExitUnknown

	// ExitNoCommandName if Execute is passed a zero-length string slice, without a command name as the first element.
	ExitNoCommandName

	// ExitParsingArguments if parsing arguments goes awry.
	ExitParsingArguments
)

Exit status codes returned by the CLI.

Variables

View Source
var ErrUnknownArguments = errors.New("unknown arguments passed in")

Functions

func Execute

func Execute(stdout, stderr io.Writer, args []string) int

Execute creates a new root command, sets flags appropriately, connects the two given io.Writer interfaces to stdout and stderr, and passes the given string slice forward to be parsed for flags and args. This is called by main.main(). It only needs to happen once to the root command.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳