commandctrl

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 12 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 func(ctx ExecContext, args []string) tea.Msg

func NoArgCommand

func NoArgCommand(cmd tea.Cmd) Command

type CommandCompletionProvider added in v0.4.0

type CommandCompletionProvider interface {
	AttributesWithPrefix(prefix string) []string
}

type CommandController

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

func NewCommandController

func NewCommandController(historyProvider IterProvider) *CommandController

func (*CommandController) AddCommandLookupExtension

func (c *CommandController) AddCommandLookupExtension(ext CommandLookupExtension)

func (*CommandController) AddCommands

func (c *CommandController) AddCommands(ctx *CommandList)

func (*CommandController) Alias

func (c *CommandController) Alias(commandName string, aliasArgs []string) Command

func (*CommandController) Execute

func (c *CommandController) Execute(commandInput string) tea.Msg

func (*CommandController) ExecuteFile

func (c *CommandController) ExecuteFile(filename string) error

func (*CommandController) Prompt

func (c *CommandController) Prompt() tea.Msg

func (*CommandController) SetCommandCompletionProvider added in v0.4.0

func (c *CommandController) SetCommandCompletionProvider(provider CommandCompletionProvider)

type CommandList

type CommandList struct {
	Commands map[string]Command
	// contains filtered or unexported fields
}

type CommandLookupExtension

type CommandLookupExtension interface {
	LookupCommand(name string) Command
}

type ExecContext

type ExecContext struct {
	// FromFile is true if the command is executed as part of a command
	FromFile bool
}

type IterProvider

type IterProvider interface {
	Iter(ctx context.Context, category string) services.HistoryProvider
}

Jump to

Keyboard shortcuts

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