command

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 15 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, d prompt.Document) []prompt.Suggest
}

type ArgumentCompleter

type ArgumentCompleter interface {
	CompleteArguments(ctx context.Context, r *readline.Readline, d prompt.Document) []prompt.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, d prompt.Document) []prompt.Suggest

func (*Cache) Description

func (c *Cache) Description() string

func (*Cache) Execute

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

func (*Cache) Help

func (c *Cache) Help() string

func (*Cache) Name

func (c *Cache) 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

type Completer

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

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() string

func (*Exit) Name

func (c *Exit) Name() string

type FlagCompleter

type FlagCompleter interface {
	CompleteFlags(ctx context.Context, r *readline.Readline, d prompt.Document) []prompt.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, d prompt.Document) []prompt.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() string
}

type PassThroughArgsCompleter

type PassThroughArgsCompleter interface {
	CompletePassTroughArgs(ctx context.Context, r *readline.Readline, d prompt.Document) []prompt.Suggest
}

type PassThroughFlagsCompleter

type PassThroughFlagsCompleter interface {
	CompletePassTroughFlags(ctx context.Context, r *readline.Readline, d prompt.Document) []prompt.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