prompt

package
v2.0.0-...-98537dd Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 5 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)
}

Deprecated: use Prompter

View Source
var SurveyAsk = func(qs []*survey.Question, response interface{}, opts ...survey.AskOpt) error {
	return survey.Ask(qs, response, opts...)
}

Deprecated: use Prompter

View Source
var SurveyAskOne = func(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error {
	return survey.AskOne(p, response, opts...)
}

Deprecated: use Prompter

Functions

func StubConfirm deprecated

func StubConfirm(result bool) func()

Deprecated: use PrompterMock

Types

type AskStubber

type AskStubber struct {
	// contains filtered or unexported fields
}

func InitAskStubber deprecated

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

Deprecated: use NewAskStubber

func NewAskStubber deprecated

func NewAskStubber(t testing) *AskStubber

Deprecated: use PrompterMock

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