prompt

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Confirm = func(prompt string, result *bool) error {
	p := &survey.Confirm{
		Message: prompt,
		Default: true,
	}
	return SurveyAskOne(p, result)
}
View Source
var SurveyAsk = func(qs []*survey.Question, response interface{}, opts ...survey.AskOpt) error {
	return survey.Ask(qs, response, opts...)
}
View Source
var SurveyAskOne = func(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error {
	return survey.AskOne(p, response, opts...)
}

Functions

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