Documentation ¶
Overview ¶
Package prompt provides functions for prompting decisions via the CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Suggestion ¶
The Suggestion type represents a recommended action a user should take. It can either be a message but can also include a suggested command.
func NewSuggestion ¶
func NewSuggestion(opts ...SuggestionOption) Suggestion
NewSuggestion creates a new Suggestion type and applies all SuggestionOption functions to it.
type SuggestionOption ¶
type SuggestionOption func(a *Suggestion)
The SuggestionOption is a function that modifies the fields of a Suggestion.
func WithCommand ¶
func WithCommand(format string, args ...interface{}) SuggestionOption
WithCommand sets the formatted command of a Suggestion.
func WithLink ¶
func WithLink(url string) SuggestionOption
WithLink sets the link of a Suggestion for a user to navigate to.
func WithMessage ¶
func WithMessage(format string, args ...interface{}) SuggestionOption
WithMessage sets the formatted message of a Suggestion.
Click to show internal directories.
Click to hide internal directories.