command

package
v0.0.0-...-842050a Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBuilder

type CommandBuilder[T any] struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder[T any](name, usage string, defaultConfig T, options ...CommandOption) *CommandBuilder[T]

func (*CommandBuilder[T]) AddHandlers

func (cb *CommandBuilder[T]) AddHandlers(h ...CommandHandler[T]) *CommandBuilder[T]

func (*CommandBuilder[T]) Build

func (cb *CommandBuilder[T]) Build() *cli.Command

type CommandHandler

type CommandHandler[T any] interface {
	Handle(c *cli.Context, cfg T) error
}

type CommandOption

type CommandOption interface {
	// contains filtered or unexported methods
}

func WithAlias

func WithAlias(alias []string) CommandOption

func WithFlags

func WithFlags(flags cli.Flag) CommandOption

type InlineHandler

type InlineHandler[T any] func(c *cli.Context, cfg T) error

func (InlineHandler[T]) Handle

func (s InlineHandler[T]) Handle(c *cli.Context, cfg T) error

Jump to

Keyboard shortcuts

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