Documentation ¶
Index ¶
- func Bold(s string) string
- func Confirm(m string, value bool, o ...Opt) (bool, error)
- func GetOutput() io.Writer
- func Italic(s string) string
- func MultiSelect(m string, choices []string, o ...Opt) ([]int, error)
- func Open(url string) *exec.Cmd
- func Password(m string, o ...Opt) (string, error)
- func Prompt(label string, value string, o ...Opt) (string, error)
- func ResetPromptLib()
- func Select(m string, value string, choices []string, o ...Opt) (int, error)
- func SetOutput(out io.Writer)
- func SetPromptLib(p PromptLib)
- func Underline(s string) string
- func Wrap(lim uint, args ...interface{}) string
- func WrapSprintf(lim uint, format string, a ...interface{}) string
- func WrapString(lim uint, s string) string
- type Logger
- type Opt
- type Opts
- type PromptLib
- type SurveyUI
- func (sui *SurveyUI) Confirm(m string, defaultValue bool, o ...Opt) (bool, error)
- func (sui *SurveyUI) MultiSelect(m string, choices []string, o ...Opt) ([]int, error)
- func (sui *SurveyUI) Password(m string, o ...Opt) (string, error)
- func (sui *SurveyUI) Prompt(label string, value string, o ...Opt) (string, error)
- func (sui *SurveyUI) Select(m string, value string, choices []string, o ...Opt) (int, error)
- type TestPrompts
- func (t *TestPrompts) Confirm(m string, v bool, o ...Opt) (bool, error)
- func (t *TestPrompts) MultiSelect(m string, choices []string, o ...Opt) ([]int, error)
- func (t *TestPrompts) Password(m string, o ...Opt) (string, error)
- func (t *TestPrompts) Prompt(label string, value string, o ...Opt) (string, error)
- func (t *TestPrompts) Select(m string, value string, choices []string, o ...Opt) (int, error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetPromptLib ¶
func ResetPromptLib()
func SetPromptLib ¶
func SetPromptLib(p PromptLib)
func WrapSprintf ¶
func WrapString ¶
Types ¶
type Logger ¶
type Logger func(args ...interface{})
var LogFn Logger
set a Logger during a test (cli.LogFn = t.Log) to debug interactive prompts
type Opt ¶
type Opt func(o *Opts)
func NewEmailValidator ¶
func NewEmailValidator() Opt
func NewLengthValidator ¶
func NewPathOrURLValidator ¶
func NewPathOrURLValidator() Opt
func NewURLValidator ¶
type PromptLib ¶
type PromptLib interface { Prompt(label string, value string, opt ...Opt) (string, error) Confirm(m string, defaultValue bool, o ...Opt) (bool, error) Password(m string, o ...Opt) (string, error) Select(m string, value string, choices []string, o ...Opt) (int, error) MultiSelect(m string, choices []string, o ...Opt) ([]int, error) }
func NewTestPrompts ¶
func NewTestPrompts(inputs []interface{}) PromptLib
type SurveyUI ¶
type SurveyUI struct{}
func (*SurveyUI) MultiSelect ¶
type TestPrompts ¶
type TestPrompts struct {
// contains filtered or unexported fields
}
func (*TestPrompts) MultiSelect ¶
type Validator ¶
func EmailValidator ¶
func EmailValidator() Validator
func LengthValidator ¶
func PathOrURLValidator ¶
func PathOrURLValidator() Validator
func URLValidator ¶
Click to show internal directories.
Click to hide internal directories.