Documentation ¶
Index ¶
- Constants
- type AskManyOpts
- type AutocompleteFunc
- type SurveyWrap
- type SurveyWrapper
- type SwizCli
- func (l *SwizCli) Ask(prompt string, required bool) (string, error)
- func (l *SwizCli) AskAutocomplete(prompt string, required bool, complete AutocompleteFunc) (string, error)
- func (l *SwizCli) AskConfirm(prompt string) (bool, error)
- func (l *SwizCli) AskMany(prompts []AskManyOpts) (map[string]string, error)
- func (l *SwizCli) AskOptions(prompt string, options []string) (string, error)
- func (l *SwizCli) Info(format string, i ...interface{})
- func (l *SwizCli) Infoln(i ...interface{})
- type SwizClier
- type TransformModeType
Constants ¶
View Source
const ( TransformModeNone = iota TransformModeTrimSpace TransformModeCamelCase )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AskManyOpts ¶
type AskManyOpts struct { Key string Message string Required bool TransformMode TransformModeType }
type AutocompleteFunc ¶
type SurveyWrap ¶
type SurveyWrap struct { }
SurveyWrap wraps the survey package
func (SurveyWrap) Ask ¶
func (SurveyWrap) Ask(qs []*survey.Question, response interface{}, opts ...survey.AskOpt) error
Ask is a wrapper for the survey.Ask() func
func (SurveyWrap) AskOne ¶
func (SurveyWrap) AskOne(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error
AskOne is a wrapper for the survey.AskOne() func
type SurveyWrapper ¶
type SurveyWrapper interface { AskOne(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error Ask(qs []*survey.Question, response interface{}, opts ...survey.AskOpt) error }
SurveyWrapper is a wrapper around the survey package. This makes the cli package unit testable.
type SwizCli ¶
type SwizCli struct {
// contains filtered or unexported fields
}
func (*SwizCli) AskAutocomplete ¶
func (l *SwizCli) AskAutocomplete(prompt string, required bool, complete AutocompleteFunc) (string, error)
AskAutocomplete asks a question with autocomplete
func (*SwizCli) AskConfirm ¶
AskConfirm asks the user to confirm with Y/n
func (*SwizCli) AskMany ¶
func (l *SwizCli) AskMany(prompts []AskManyOpts) (map[string]string, error)
AskMany asks many questions
func (*SwizCli) AskOptions ¶
AskOptions asks with a list of options
type SwizClier ¶
type SwizClier interface { Info(format string, i ...interface{}) Infoln(i ...interface{}) Ask(prompt string, required bool) (string, error) AskAutocomplete(prompt string, required bool, complete AutocompleteFunc) (string, error) AskConfirm(prompt string) (bool, error) AskOptions(prompt string, options []string) (string, error) AskMany(prompts []AskManyOpts) (map[string]string, error) }
type TransformModeType ¶
type TransformModeType int
Click to show internal directories.
Click to hide internal directories.