Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserCancel = errors.New("user cancelled")
Functions ¶
func RunUI ¶
func RunUI(c Controller, opts Options) error
RunUI starts the gencmd UI with the provided controller and options.
func SelectProvider ¶
SelectProvider allows the user to select a provider and input its configuration.
Types ¶
type Controller ¶
type Controller interface {
LoadHistory() []ctrl.HistoryEntry
UpdateHistory(prompt, command string) error
DeleteHistory(entry ctrl.HistoryEntry) error
GenerateCommands(prompt string) ([]string, error)
}
type FakeController ¶
type FakeController struct {
// contains filtered or unexported fields
}
func NewFakeController ¶
func NewFakeController() *FakeController
func (*FakeController) DeleteHistory ¶ added in v0.3.0
func (f *FakeController) DeleteHistory(entry ctrl.HistoryEntry) error
func (*FakeController) GenerateCommands ¶
func (f *FakeController) GenerateCommands(string) ([]string, error)
func (*FakeController) LoadHistory ¶
func (f *FakeController) LoadHistory() []ctrl.HistoryEntry
func (*FakeController) UpdateHistory ¶
func (f *FakeController) UpdateHistory(prompt, command string) error
type KeyMap ¶
type KeyMap struct {
Submit key.Binding
Cancel key.Binding
Up key.Binding
Down key.Binding
ToggleHistory key.Binding
DeleteHistory key.Binding
ToggleHelp key.Binding
}
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
Click to show internal directories.
Click to hide internal directories.