Documentation ¶
Index ¶
- func Bold(s string) string
- func Italic(s string) string
- func Open(url string) *exec.Cmd
- func Prompt(label string, value string, edit bool, validator Validator) (string, error)
- func PromptBoolean(m string, defaultValue bool) (bool, error)
- func PromptChoices(m string, value string, choices []string) (int, error)
- func PromptMultipleChoices(m string, choices []string) ([]int, error)
- func PromptSecret(m string) (string, error)
- func PromptWithHelp(label string, value string, edit bool, validator Validator, help string) (string, error)
- func PromptYN(m string) (bool, error)
- func ResetPromptLib()
- 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 PromptLib
- type SurveyUI
- func (sui *SurveyUI) Prompt(label string, value string, edit bool, validator Validator) (string, error)
- func (sui *SurveyUI) PromptChoices(m string, value string, choices []string) (int, error)
- func (sui *SurveyUI) PromptMultipleChoices(m string, choices []string) ([]int, error)
- func (sui *SurveyUI) PromptSecret(m string) (string, error)
- func (sui *SurveyUI) PromptWithHelp(label string, value string, edit bool, validator Validator, help string) (string, error)
- func (sui *SurveyUI) PromptYN(m string, defaultValue bool) (bool, error)
- type TestPrompts
- func (t *TestPrompts) Prompt(label string, value string, edit bool, validator Validator) (string, error)
- func (t *TestPrompts) PromptChoices(m string, value string, choices []string) (int, error)
- func (t *TestPrompts) PromptMultipleChoices(m string, choices []string) ([]int, error)
- func (t *TestPrompts) PromptSecret(m string) (string, error)
- func (t *TestPrompts) PromptWithHelp(label string, value string, edit bool, validator Validator, help string) (string, error)
- func (t *TestPrompts) PromptYN(m string, defaultValue bool) (bool, error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PromptSecret ¶
func PromptWithHelp ¶
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 PromptLib ¶
type PromptLib interface { Prompt(label string, value string, edit bool, validator Validator) (string, error) PromptWithHelp(label string, value string, edit bool, validator Validator, help string) (string, error) PromptYN(m string, defaultValue bool) (bool, error) PromptSecret(m string) (string, error) PromptChoices(m string, value string, choices []string) (int, error) PromptMultipleChoices(m string, choices []string) ([]int, error) }
func NewTestPrompts ¶
func NewTestPrompts(inputs []interface{}) PromptLib
type SurveyUI ¶
type SurveyUI struct{}
func (*SurveyUI) PromptChoices ¶
func (*SurveyUI) PromptMultipleChoices ¶
func (*SurveyUI) PromptWithHelp ¶
type TestPrompts ¶
type TestPrompts struct {
// contains filtered or unexported fields
}
func (*TestPrompts) PromptChoices ¶
func (*TestPrompts) PromptMultipleChoices ¶
func (t *TestPrompts) PromptMultipleChoices(m string, choices []string) ([]int, error)
func (*TestPrompts) PromptSecret ¶
func (t *TestPrompts) PromptSecret(m string) (string, error)
func (*TestPrompts) PromptWithHelp ¶
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.