command

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	FlagParse(clause *kingpin.CmdClause)
	Exec(ctx context.Context, subCommands *Sub) error
}

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func New

func New(name, help string) *Executor

func (*Executor) AddFlag

func (e *Executor) AddFlag(name, help string) *kingpin.FlagClause

func (*Executor) Exec

func (e *Executor) Exec(ctx context.Context) error

func (*Executor) ExecCommandName

func (e *Executor) ExecCommandName() string

func (*Executor) FlagParse

func (e *Executor) FlagParse() error

func (*Executor) Register

func (e *Executor) Register(name string, command Command, helpText string) *Executor

func (*Executor) SetEnvFilePath

func (e *Executor) SetEnvFilePath(path string) *Executor

type Sub

type Sub struct {
	// contains filtered or unexported fields
}

func NewSub

func NewSub(commands string) (*Sub, error)

func (*Sub) Clone

func (s *Sub) Clone() *Sub

func (*Sub) Next

func (s *Sub) Next() (string, bool)

Jump to

Keyboard shortcuts

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