2020-09-14 18:31:56 +00:00
|
|
|
// Package promptui is a library providing a simple interface to create command-line prompts for go.
|
|
|
|
// It can be easily integrated into spf13/cobra, urfave/cli or any cli go application.
|
|
|
|
//
|
|
|
|
// promptui has two main input modes:
|
|
|
|
//
|
|
|
|
// Prompt provides a single line for user input. It supports optional live validation,
|
|
|
|
// confirmation and masking the input.
|
|
|
|
//
|
|
|
|
// Select provides a list of options to choose from. It supports pagination, search,
|
|
|
|
// detailed view and custom templates.
|
2018-05-15 21:13:11 +00:00
|
|
|
package promptui
|
|
|
|
|
|
|
|
import "errors"
|
|
|
|
|
2020-09-14 18:31:56 +00:00
|
|
|
// ErrEOF is the error returned from prompts when EOF is encountered.
|
2018-05-15 21:13:11 +00:00
|
|
|
var ErrEOF = errors.New("^D")
|
|
|
|
|
2020-09-14 18:31:56 +00:00
|
|
|
// ErrInterrupt is the error returned from prompts when an interrupt (ctrl-c) is
|
2018-05-15 21:13:11 +00:00
|
|
|
// encountered.
|
|
|
|
var ErrInterrupt = errors.New("^C")
|
|
|
|
|
2020-09-14 18:31:56 +00:00
|
|
|
// ErrAbort is the error returned when confirm prompts are supplied "n"
|
2018-05-15 21:13:11 +00:00
|
|
|
var ErrAbort = errors.New("")
|
|
|
|
|
2020-09-14 18:31:56 +00:00
|
|
|
// ValidateFunc is a placeholder type for any validation functions that validates a given input. It should return
|
|
|
|
// a ValidationError if the input is not valid.
|
2018-05-15 21:13:11 +00:00
|
|
|
type ValidateFunc func(string) error
|