couleuvre

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App added in v0.3.0

type App[T Config] struct {
	// String to use as prefix for environment variables parsing
	EnvPrefix string

	// String to replace for environment variables parsing
	EnvReplaceFrom string

	// String to replace to for environment variables parsing
	EnvReplaceTo string

	Config T
	// contains filtered or unexported fields
}

func NewApp added in v0.3.0

func NewApp[T Config](envPrefix, envReplaceFrom, envReplaceTo string) (a App[T])

func (*App[T]) AddCommands added in v0.5.0

func (a *App[T]) AddCommands(commands ...Command) error

func (App[T]) Commands added in v0.5.0

func (a App[T]) Commands() []Command

func (*App[T]) NewCommand added in v0.8.0

func (a *App[T]) NewCommand(name, description string, executer ExecuterFunc, aliases ...string) error

func (*App[T]) Parse added in v0.3.0

func (a *App[T]) Parse() (err error)

func (App[T]) ParseCommand added in v0.6.0

func (a App[T]) ParseCommand(cmd string) (found Command, err error)

func (App[T]) ParseToDestination added in v0.10.0

func (a App[T]) ParseToDestination(destination any) (err error)

type Command added in v0.2.0

type Command struct {
	// flag.FlagSet
	Name        string
	Aliases     []string
	Description string
	// Subcommands []Command
	Executer ExecuterFunc
}

func NewCommand added in v0.5.0

func NewCommand(name string, description string, executer ExecuterFunc, aliases ...string) (command Command, err error)

func ParseCommand added in v0.2.0

func ParseCommand(cmds []Command, cmd string) (found Command, err error)

func (Command) Complete added in v0.5.0

func (c Command) Complete() bool

func (Command) Execute added in v0.7.0

func (c Command) Execute() error

func (Command) String added in v0.2.0

func (c Command) String() string

type Config added in v0.9.0

type Config interface{}

type ExecuterFunc added in v0.7.0

type ExecuterFunc func() error

Jump to

Keyboard shortcuts

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