Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PromptForConfirmation
deprecated
PromptForConfirmation prompts the user for y/N confirmation. Uses the provided reader for input (pass cmd.InOrStdin() for testability). Returns true only for "y" or "Y", false for anything else including errors. Writes prompt to stderr (not stdout) to preserve stdout for data output.
Deprecated: Use Prompter.Confirm() instead for better testability.
Types ¶
type PromptConfig ¶
type PromptConfig struct {
Message string
Default string
Required bool
Validator func(string) error
}
PromptConfig configures a string prompt.
type Prompter ¶
type Prompter struct {
// contains filtered or unexported fields
}
Prompter provides interactive prompting functionality. It uses IOStreams for testable I/O.
func NewPrompter ¶
NewPrompter creates a new Prompter with the given IOStreams.
func (*Prompter) Confirm ¶
Confirm prompts the user for a yes/no confirmation. In non-interactive mode, returns the default without prompting.
type SelectOption ¶
SelectOption represents an option in a selection prompt.