prompt

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EditorQuestionTemplate = `` /* 714-byte string literal not displayed */

EXTENDED to change prompt text

View Source
var Icons = survey.WithIcons(func(icons *survey.IconSet) {
	icons.Question.Text = ""
})

Functions

func Ask

func Ask(inputs []*survey.Question, response interface{}) error

func AskOne

func AskOne(input *survey.Question, response interface{}) error

func BoolInput

func BoolInput(name string, message string, help string, defaultValue bool, required bool) *survey.Question

func CaptureInputViaEditor added in v0.3.0

func CaptureInputViaEditor(contents, pattern string, infoFn func()) (result string, err error)

CaptureInputViaEditor is the high level function to use in this package in order to capture input from an editor.

The arguments have been tailored for our use of strings mostly in the rest of the CLI even though internally we're using []byte.

func Confirm

func Confirm(message string) bool

func ConfirmDefault added in v0.4.1

func ConfirmDefault(message string, defaultValue bool) bool

func SelectInput

func SelectInput(name string, message string, help string, options []string, defaultValue string, required bool) *survey.Question

func TextInput

func TextInput(name string, message string, help string, defaultValue string, required bool) *survey.Question

Types

type Editor added in v0.4.0

type Editor struct {
	*survey.Editor
	EditorCommand string
	BlankAllowed  bool
}

EXTENDED to enable different prompting behavior

func (*Editor) Prompt added in v0.4.0

func (e *Editor) Prompt(config *survey.PromptConfig) (interface{}, error)

EXTENDED This is straight copypasta from survey to get our overridden prompt called.

type EditorTemplateData added in v0.4.0

type EditorTemplateData struct {
	survey.Editor
	EditorCommand string
	BlankAllowed  bool
	Answer        string
	ShowAnswer    bool
	ShowHelp      bool
	Config        *survey.PromptConfig
}

EXTENDED to pass editor name (to use in prompt)

Jump to

Keyboard shortcuts

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