interactive

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidValue   = errors.New("invalid value")
	ErrRequiredValue  = errors.New("required value")
	ErrNonInteractive = errors.New("refusing to run with non-interactive flag")
)

Functions

func All

func All(funcs ...survey.Validator) survey.Validator

func Ask

func Ask(question string, validate survey.Validator) (string, error)

func AskInt32

func AskInt32(question string, validate survey.Validator) (int32, error)

func AskMissingRequiredFlags

func AskMissingRequiredFlags(command *cobra.Command)

func AskPath

func AskPath(question string, value string, validate survey.Validator) (string, error)

func AskSecretWithHelp

func AskSecretWithHelp(question string, help string, validate survey.Validator) (string, error)

func AskWithHelp added in v0.14.1

func AskWithHelp(question string, help string, validate survey.Validator) (string, error)

func AssertBetween

func AssertBetween(min int32, max int32) survey.Validator

func AssertMinimumLength

func AssertMinimumLength(length int) survey.Validator

func Choose

func Choose(question string, items []string) (int, string, error)

func ChooseWithSize

func ChooseWithSize(size int, question string, items []string) (int, string, error)

func Confirm

func Confirm(question string) (bool, error)

func ConfirmWithHelp added in v0.14.1

func ConfirmWithHelp(question string, help string) (bool, error)

func Lowercase

func Lowercase() survey.Validator

Types

type Input added in v0.14.1

type Input struct {
	survey.Input
	// contains filtered or unexported fields
}

func NewInput added in v0.14.1

func NewInput(message string) *Input

func (*Input) AskString added in v0.14.1

func (question *Input) AskString() (string, error)

func (*Input) SetValidate added in v0.14.1

func (question *Input) SetValidate(validate survey.Validator) *Input

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL