prompt

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

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 handles interactive CLI prompts

func New

func New() *Prompter

New creates a new Prompter instance

func (*Prompter) Confirm

func (p *Prompter) Confirm(question string, defaultYes bool) bool

Confirm prompts for yes/no confirmation

func (*Prompter) Input

func (p *Prompter) Input(question string, validator func(string) error) string

Input prompts for text input with optional validation

func (*Prompter) InputWithDefault

func (p *Prompter) InputWithDefault(question, defaultValue string, validator func(string) error) string

InputWithDefault prompts for text input with a default value

func (*Prompter) MultiSelect

func (p *Prompter) MultiSelect(question string, options []string) []int

MultiSelect prompts for multiple choices (space-separated indices)

func (*Prompter) Password

func (p *Prompter) Password(question string) string

Password prompts for password input (hidden)

func (*Prompter) Select

func (p *Prompter) Select(question string, options []string) int

Select prompts for single choice from options

func (*Prompter) SelectWithDefault

func (p *Prompter) SelectWithDefault(question string, options []string, defaultIndex int) int

SelectWithDefault prompts for single choice with a default option

func (*Prompter) ShowSummary

func (p *Prompter) ShowSummary(title string, items map[string]string)

ShowSummary displays a formatted summary

Jump to

Keyboard shortcuts

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