prompt

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ask = survey.Ask
View Source
var AskOne = survey.AskOne
View Source
var Confirm = func(result *bool, prompt string, defaultVal bool) error {
	p := &survey.Confirm{
		Message: prompt,
		Default: defaultVal,
	}
	return survey.AskOne(p, result)
}

Functions

func AskMultiline

func AskMultiline(response interface{}, name, question string, defaultVal string) error

func AskQuestionWithInput

func AskQuestionWithInput(response interface{}, name, question, defaultVal string, isRequired bool) error

func MultiSelect

func MultiSelect(response interface{}, name, question string, options []string, opts ...survey.AskOpt) error

func Select added in v1.14.0

func Select(response interface{}, name string, question string, options []string, opts ...survey.AskOpt) error

func StubConfirm

func StubConfirm(result bool) func()

Types

type AskStubber

type AskStubber struct {
	Asks     [][]*survey.Question
	AskOnes  []*survey.Prompt
	Count    int
	OneCount int
	Stubs    [][]*QuestionStub
	StubOnes []*PromptStub
}

func InitAskStubber

func InitAskStubber() (*AskStubber, func())

func (*AskStubber) Stub

func (as *AskStubber) Stub(stubbedQuestions []*QuestionStub)

func (*AskStubber) StubOne

func (as *AskStubber) StubOne(value interface{})

func (*AskStubber) StubOneDefault

func (as *AskStubber) StubOneDefault()

type PromptStub

type PromptStub struct {
	Value   interface{}
	Default bool
}

type QuestionStub

type QuestionStub struct {
	Name    string
	Value   interface{}
	Default bool
}

Jump to

Keyboard shortcuts

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