command

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action[T any] interface {
	Run(opts ...Option[T]) error
}

type App

type App interface {
	ExecName() string
	Args() []string

	UserConfig() *types.Config
	ProfileConfig(profile string) *types.Config

	Command(name string) bool
	RunSubCommand() error

	Usage(format string)
	Exit(code int)
	Printf(format string, a ...interface{}) (n int, err error)
}

type Handler

type Handler[T any] interface {
	Handle(App) (Action[T], []Option[T], error)
}

type Option

type Option[T any] func(*T)

Jump to

Keyboard shortcuts

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