Documentation ¶
Index ¶
- func Completer[T any](cmd *cobra.Command, ...)
- func ExecModel(cmd *cobra.Command, model tea.Model) error
- func FilterShellCompletions[T any](options []string, toComplete string) []string
- func FilterShellCompletionsWith[T any](options []string, toComplete string, ...) []string
- func GetSelectedSuggestion[T any](cmd *cobra.Command) *suggestion.Suggestion[commandinput.CommandMetadata[T]]
- func PreservePlaceholder(cmd *cobra.Command, flag string)
- func ShowFlagPlaceholder(cmd *cobra.Command, show bool)
- type CompleterFinish
- type CompleterStart
- type ExecutorFinish
- type ExecutorStart
- type Model
- func (m Model[T]) Init() tea.Cmd
- func (m *Model[T]) SetFilterer(filterer completer.Filterer[commandinput.CommandMetadata[T]])
- func (m *Model[T]) SetIgnoreCmds(ignoreCmds ...string)
- func (m *Model[T]) SetOnCompleterFinish(onCompleterFinish CompleterFinish[T])
- func (m *Model[T]) SetOnCompleterStart(onCompleterStart CompleterStart[T])
- func (m *Model[T]) SetOnExecutorFinish(onExecutorFinish ExecutorFinish)
- func (m *Model[T]) SetOnExecutorStart(onExecutorStart ExecutorStart[T])
- func (m Model[T]) Start() error
- func (m Model[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model[T]) View() string
- type Option
- func WithIgnoreCmds[T any](cmds ...string) Option[T]
- func WithOnCompleterFinish[T any](onCompleterStart CompleterFinish[T]) Option[T]
- func WithOnCompleterStart[T any](onCompleterStart CompleterStart[T]) Option[T]
- func WithOnExecutorFinish[T any](onExecutorFinish ExecutorFinish) Option[T]
- func WithOnExecutorStart[T any](onExecutorStart ExecutorStart[T]) Option[T]
- func WithPromptOptions[T any](options ...prompt.Option[commandinput.CommandMetadata[T]]) Option[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Completer ¶
func Completer[T any](cmd *cobra.Command, f func(cmd *cobra.Command, args []string, toComplete string) ([]suggestion.Suggestion[commandinput.CommandMetadata[T]], error), )
func FilterShellCompletions ¶
func FilterShellCompletionsWith ¶
func FilterShellCompletionsWith[T any](options []string, toComplete string, filterer completer.Filterer[commandinput.CommandMetadata[T]], ) []string
func GetSelectedSuggestion ¶
func GetSelectedSuggestion[T any](cmd *cobra.Command) *suggestion.Suggestion[commandinput.CommandMetadata[T]]
func PreservePlaceholder ¶
func ShowFlagPlaceholder ¶
Types ¶
type CompleterFinish ¶
type CompleterFinish[T any] func(suggestions []suggestion.Suggestion[commandinput.CommandMetadata[T]], err error) ( []suggestion.Suggestion[commandinput.CommandMetadata[T]], error)
type CompleterStart ¶
type CompleterStart[T any] func(promptModel prompt.Model[commandinput.CommandMetadata[T]])
type ExecutorStart ¶
type ExecutorStart[T any] func(input string, selectedSuggestion *suggestion.Suggestion[commandinput.CommandMetadata[T]])
type Model ¶
type Model[T any] struct { // contains filtered or unexported fields }
func (*Model[T]) SetFilterer ¶
func (m *Model[T]) SetFilterer(filterer completer.Filterer[commandinput.CommandMetadata[T]])
func (*Model[T]) SetIgnoreCmds ¶
func (*Model[T]) SetOnCompleterFinish ¶
func (m *Model[T]) SetOnCompleterFinish(onCompleterFinish CompleterFinish[T])
func (*Model[T]) SetOnCompleterStart ¶
func (m *Model[T]) SetOnCompleterStart(onCompleterStart CompleterStart[T])
func (*Model[T]) SetOnExecutorFinish ¶
func (m *Model[T]) SetOnExecutorFinish(onExecutorFinish ExecutorFinish)
func (*Model[T]) SetOnExecutorStart ¶
func (m *Model[T]) SetOnExecutorStart(onExecutorStart ExecutorStart[T])
type Option ¶
func WithIgnoreCmds ¶
func WithOnCompleterFinish ¶
func WithOnCompleterFinish[T any](onCompleterStart CompleterFinish[T]) Option[T]
func WithOnCompleterStart ¶
func WithOnCompleterStart[T any](onCompleterStart CompleterStart[T]) Option[T]
func WithOnExecutorFinish ¶
func WithOnExecutorStart ¶
func WithPromptOptions ¶
func WithPromptOptions[T any](options ...prompt.Option[commandinput.CommandMetadata[T]]) Option[T]
Click to show internal directories.
Click to hide internal directories.