Documentation ¶
Index ¶
- func AskForDateTime(name, value string, convert func(string) (time.Time, error)) (time.Time, error)
- func AskForDateTimeOrNil(name, value string, convert func(string) (time.Time, error)) (*time.Time, error)
- func AskForInt(message string, d int) (int, error)
- func AskForText(message string, opts ...InputOption) (string, error)
- func AskFromOptions(message string, options []string, d string) (string, error)
- func AskManyFromOptions(message string, opts, d []string) ([]string, error)
- func Confirm(message string, d bool) (bool, error)
- func SetDefaultOptions(opt ...survey.AskOpt)
- type InputOption
- type RGB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskForDateTime ¶
func AskForDateTime( name, value string, convert func(string) (time.Time, error), ) (time.Time, error)
AskForDateTime interactively ask for one date and time from the user
func AskForDateTimeOrNil ¶
func AskForText ¶
func AskForText(message string, opts ...InputOption) (string, error)
AskForText interactively ask for one string from the user
func AskFromOptions ¶
AskFromOptions interactively ask the user to choose one option or none
func AskManyFromOptions ¶
AskManyFromOptions interactively ask the user to choose none or many option
func SetDefaultOptions ¶ added in v0.38.2
func SetDefaultOptions(opt ...survey.AskOpt)
Types ¶
type InputOption ¶
type InputOption func(*survey.Input)
InputOption represets a funcion the customizes a survey.Input object
func WithDefault ¶
func WithDefault(d string) InputOption
WithDefault will set a default answer to the question
func WithSuggestion ¶
func WithSuggestion(fn func(toComplete string) []string) InputOption
WithSuggestion applies the suggestion function to the input question
Click to show internal directories.
Click to hide internal directories.