cli

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 4 Imported by: 0

README

cli

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailure = errors.New("failure")

ErrFailure can be returned from a command to trigger a non-zero exit code with no extra message.

Functions

func Parse

func Parse[T any]() *T

func ParseExecute

func ParseExecute[T any]() *T

Types

type Commander

type Commander interface {
	Execute(args []string) error
}

Commander is a required interface for CLI commands.

type Initer

type Initer[T any] interface {
	Init(app *T) error
}

Initer is an optional interface for commands that require global flags. The command can read the global values and store them to be later used in Execute.

type Validator

type Validator interface {
	Validate() error
}

Validator is an optional interface for commands that require additional validation of their flags.

Jump to

Keyboard shortcuts

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