prompt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 PromptBoolSelect(label string) (bool, error)

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

func PromptStringMultiSelect(label string, size int, items []string) ([]string, error)

PromptStringMultiSelect prompt select from slice

func PromptStringSelect

func PromptStringSelect(label string, size int, items []string) (string, error)

PromptStringSelect prompt select from slice

func PromptStringSlice

func PromptStringSlice(label string) ([]string, error)

PromptStringSlice prompt for string slice

func PromptStringWithValidator

func PromptStringWithValidator(name string, validator survey.Validator, opts ...PromptOption) (string, error)

func SelectSubCommand

func SelectSubCommand(cmd *cobra.Command, args []string)

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
}

Jump to

Keyboard shortcuts

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