prompt

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 {
	// contains filtered or unexported fields
}

func InitAskStubber deprecated

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

Deprecated: use NewAskStubber

func NewAskStubber

func NewAskStubber(t testing) *AskStubber

func (*AskStubber) Stub deprecated

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

Deprecated: use StubPrompt

func (*AskStubber) StubOne deprecated

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

Deprecated: use StubPrompt

func (*AskStubber) StubPrompt

func (as *AskStubber) StubPrompt(msg string) *QuestionStub

StubPrompt records a stub for an interactive prompt matched by its message.

type QuestionStub

type QuestionStub struct {
	Name    string
	Value   interface{}
	Default bool
	// contains filtered or unexported fields
}

func (*QuestionStub) AnswerDefault

func (s *QuestionStub) AnswerDefault() *QuestionStub

AnswerDefault marks the current stub to be answered with the default value for the prompt question.

func (*QuestionStub) AnswerWith

func (s *QuestionStub) AnswerWith(v interface{}) *QuestionStub

AnswerWith defines an answer for the given stub.

func (*QuestionStub) AssertOptions

func (s *QuestionStub) AssertOptions(opts []string) *QuestionStub

AssertOptions asserts the options presented to the user in Selects and MultiSelects.

Jump to

Keyboard shortcuts

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