Documentation
¶
Overview ¶
Package prompt provides small interactive command-line prompt helpers for jugctl commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prompter ¶
type Prompter struct {
// contains filtered or unexported fields
}
Prompter reads prompts from in and writes them to out, defaulting to os.Stdin and os.Stdout when constructed via New.
func New ¶
New returns a Prompter reading from in and writing prompts to out.
func (*Prompter) Confirm ¶
Confirm asks a yes/no question, defaulting to No on empty input. Only "y" or "yes" (case-insensitive) are treated as confirmation.
func (*Prompter) RequiredText ¶
RequiredText prompts for a line of input, re-asking until a non-empty value is entered.
func (*Prompter) Select ¶
Select prompts the user to choose one of options, listing them as numbered choices, and returns the chosen option. It re-asks on an invalid or out-of-range selection.
Source Files
¶
- prompt.go