prompt

package
v0.1.1-experimental.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prompt

type Prompt struct {
	Cmd *cobra.Command

	Text       string
	Default    string
	ValidateFn func(string) error
}

func (*Prompt) Ask

func (p *Prompt) Ask() (string, error)

Ask prompts the user and stores their response.

func (*Prompt) AskAndValidate

func (p *Prompt) AskAndValidate() (string, error)

AskAndValidate prompts the user and validates their response. Equivalent to Ask() if no validate function is specified.

type Reader

type Reader interface {
	Read([]byte) (int, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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