Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAnswerFunc = func(answer string) string { return pp.Yellow(answer) }
DefaultAnswerFunc styles the answer text in yellow.
View Source
var DefaultCursorFunc = func(cursor string) string { return pp.Yellow(cursor) }
DefaultCursorFunc styles the cursor text in yellow.
View Source
var DefaultIconFunc = func(icon string) string { return pp.Cyan(icon) }
DefaultIconFunc styles the icon text in cyan.
View Source
var DefaultSelectFunc = func(s string) string { return pp.Green(s) }
DefaultSelectFunc styles the selected option text in green.
Functions ¶
This section is empty.
Types ¶
type Example ¶
type Example struct {
Name string // Name of the example to be displayed in the selection prompt.
Fn func() // Function to execute when the example is selected.
}
Example represents a single example with a name and an associated function to execute.
type ExamplePrompt ¶
type ExamplePrompt struct {
// contains filtered or unexported fields
}
ExamplePrompt manages a collection of examples and handles user interaction.
func NewExamplePrompt ¶
func NewExamplePrompt(examples []Example) *ExamplePrompt
NewExamplePrompt creates a new ExamplePrompt with the provided examples.
func (*ExamplePrompt) Repeat ¶
func (ep *ExamplePrompt) Repeat(repeat bool) *ExamplePrompt
Repeat sets whether to repeat the prompt after an example is executed.
func (*ExamplePrompt) Show ¶
func (ep *ExamplePrompt) Show()
Show displays the example prompt and handles user interaction.
func (*ExamplePrompt) Title ¶
func (ep *ExamplePrompt) Title(title string) *ExamplePrompt
Title sets the title of the example prompt.
Click to show internal directories.
Click to hide internal directories.