command

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalArgsCompleter

type AdditionalArgsCompleter interface {
	CompleteAdditionalArgs(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}

type ArgumentCompleter

type ArgumentCompleter interface {
	CompleteArguments(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}

type Cache

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

func NewCache

func NewCache(l log.Logger, cache cache.Cache) *Cache

func (*Cache) Complete

func (c *Cache) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Cache) Description

func (c *Cache) Description() string

func (*Cache) Execute

func (c *Cache) Execute(ctx context.Context, r *readline.Readline) error

func (*Cache) Help

func (c *Cache) Help(ctx context.Context, r *readline.Readline) string

func (*Cache) Name

func (c *Cache) Name() string

type Check added in v0.5.4

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

func NewCheck added in v0.5.4

func NewCheck(l log.Logger, checkers ...check.Checker) *Check

func (*Check) Complete added in v0.5.4

func (c *Check) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Check) Description added in v0.5.4

func (c *Check) Description() string

func (*Check) Execute added in v0.5.4

func (c *Check) Execute(ctx context.Context, r *readline.Readline) error

func (*Check) Help added in v0.5.4

func (c *Check) Help(ctx context.Context, r *readline.Readline) string

func (*Check) Name added in v0.5.4

func (c *Check) Name() string

type Command

type Command interface {
	Name() string
	Description() string
	Execute(ctx context.Context, r *readline.Readline) error
}

type Commands

type Commands map[string]Command

func (Commands) Add

func (c Commands) Add(commands ...Command)

func (Commands) Get

func (c Commands) Get(name string) Command

func (Commands) Has

func (c Commands) Has(name string) bool

func (Commands) List

func (c Commands) List() []Command

func (Commands) Load

func (c Commands) Load(paths ...string) error

func (Commands) MustAdd added in v0.4.0

func (c Commands) MustAdd(command Command, err error)

func (Commands) TryAdd added in v0.3.0

func (c Commands) TryAdd(command Command, err error) error

type Completer

type Completer interface {
	Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}

type Env added in v0.5.0

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

func NewEnv added in v0.5.0

func NewEnv(l log.Logger) *Env

func (*Env) Complete added in v0.5.0

func (c *Env) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Env) Description added in v0.5.0

func (c *Env) Description() string

func (*Env) Execute added in v0.5.0

func (c *Env) Execute(ctx context.Context, r *readline.Readline) error

func (*Env) Help added in v0.5.0

func (c *Env) Help(ctx context.Context, r *readline.Readline) string

func (*Env) Name added in v0.5.0

func (c *Env) Name() string

type Exit

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

func NewExit

func NewExit(l log.Logger) *Exit

func (*Exit) Description

func (c *Exit) Description() string

func (*Exit) Execute

func (c *Exit) Execute(ctx context.Context, args *readline.Readline) error

func (*Exit) Help

func (c *Exit) Help(ctx context.Context, r *readline.Readline) string

func (*Exit) Name

func (c *Exit) Name() string

type FlagCompleter

type FlagCompleter interface {
	CompleteFlags(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}

type Help

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

func NewHelp

func NewHelp(l log.Logger, commands Commands) *Help

func (*Help) Complete

func (c *Help) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Help) Description

func (c *Help) Description() string

func (*Help) Execute

func (c *Help) Execute(ctx context.Context, r *readline.Readline) error

func (*Help) Name

func (c *Help) Name() string

func (*Help) Validate

func (c *Help) Validate(ctx context.Context, r *readline.Readline) error

type Helper

type Helper interface {
	Help(ctx context.Context, r *readline.Readline) string
}

type History added in v0.4.0

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

func NewHistory added in v0.4.0

func NewHistory(l log.Logger, history history.History) *History

func (*History) Description added in v0.4.0

func (c *History) Description() string

func (*History) Execute added in v0.4.0

func (c *History) Execute(ctx context.Context, r *readline.Readline) error

func (*History) Name added in v0.4.0

func (c *History) Name() string

type Option added in v0.5.4

type Option func(*Check)

type PassThroughFlagsCompleter

type PassThroughFlagsCompleter interface {
	CompletePassTroughFlags(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}

type Validator

type Validator interface {
	Validate(ctx context.Context, r *readline.Readline) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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