Documentation ¶
Index ¶
- Constants
- func OptionalInput(ans interface{}) error
- func PromptBoolSelect(label string) (bool, error)
- func PromptOptionalString(name string, opts ...PromptOption) (string, error)
- func PromptRequiredInt32(name string, opts ...PromptOption) (int32, error)
- func PromptRequiredString(name string, opts ...PromptOption) (string, error)
- func PromptSelectWithFunc(label string, size int, getItemsFunc GetItemsFunc, funcArgs ...interface{}) (interface{}, error)
- func PromptStringMultiSelect(label string, size int, items []string) ([]string, error)
- func PromptStringSelect(label string, size int, items []string) (string, error)
- func PromptStringSlice(label string) ([]string, error)
- func PromptStringWithValidator(name string, validator survey.Validator, opts ...PromptOption) (string, error)
- func SelectSubCommand(cmd *cobra.Command, args []string)
- func ValidateIntegerNumberInput(ans interface{}) error
- type GetItemsFunc
- type PromptOption
- type PromptOptions
Constants ¶
View Source
const DefaultSelectSize = 10
View Source
const NeedPromptFlag = "needPrompt"
View Source
const SELECTICON = "\U0001F58C"
Variables ¶
This section is empty.
Functions ¶
func OptionalInput ¶
func OptionalInput(ans interface{}) error
func PromptBoolSelect ¶
func PromptOptionalString ¶
func PromptOptionalString(name string, opts ...PromptOption) (string, error)
func PromptRequiredInt32 ¶
func PromptRequiredInt32(name string, opts ...PromptOption) (int32, error)
func PromptRequiredString ¶
func PromptRequiredString(name string, opts ...PromptOption) (string, error)
func PromptSelectWithFunc ¶
func PromptSelectWithFunc(label string, size int, getItemsFunc GetItemsFunc, funcArgs ...interface{}) (interface{}, error)
PromptSelectWithFunc prompt select from slice with func
func PromptStringMultiSelect ¶
PromptStringMultiSelect prompt select from slice
func PromptStringSelect ¶
PromptStringSelect prompt select from slice
func PromptStringSlice ¶
PromptStringSlice prompt for string slice
func PromptStringWithValidator ¶
func PromptStringWithValidator(name string, validator survey.Validator, opts ...PromptOption) (string, error)
func SelectSubCommand ¶
func ValidateIntegerNumberInput ¶
func ValidateIntegerNumberInput(ans interface{}) error
Types ¶
type GetItemsFunc ¶
type GetItemsFunc func(...interface{}) ([]interface{}, error)
type PromptOption ¶
type PromptOption func(o *PromptOptions)
func WithInputMessage ¶
func WithInputMessage(message string) PromptOption
type PromptOptions ¶
type PromptOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.