Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoPrompt = errors.New("No prompt stub")
View Source
var SurveyAskOne = func(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error { err := survey.AskOne(p, response, opts...) if err != nil { if errors.Is(err, terminal.InterruptErr) { return cmdutil.ErrExecutionCanceledByUser } return err } return nil }
SurveyAskOne helper method with user interrupt check
Functions ¶
func AskConfirmation ¶
AskConfirmation make sure user confirm action, otherwise abort.
func GetPassphrase ¶
GetPassphrase check stdin if we have anything, and use that as passphrase otherwise, if we can prompt, Prompt user input
func PasswordConfirmation ¶
Types ¶
type AskStubber ¶
type AskStubber struct {
// contains filtered or unexported fields
}
func InitAskStubber ¶
func InitAskStubber(t *testing.T) (*AskStubber, func())
func (*AskStubber) Stub ¶
func (as *AskStubber) Stub(stubbedQuestions []*QuestionStub)
func (*AskStubber) StubOne ¶
func (as *AskStubber) StubOne(value interface{})
func (*AskStubber) StubPrompt ¶
func (as *AskStubber) StubPrompt(msg string) *QuestionStub
type PromptStub ¶
type PromptStub struct { Value interface{} Default bool }
type QuestionStub ¶
type QuestionStub struct { Name string Value interface{} Default bool // contains filtered or unexported fields }
func (*QuestionStub) AnswerDefault ¶
func (s *QuestionStub) AnswerDefault() *QuestionStub
func (*QuestionStub) AnswerWith ¶
func (s *QuestionStub) AnswerWith(v interface{}) *QuestionStub
Click to show internal directories.
Click to hide internal directories.