Documentation
¶
Overview ¶
Package prompt provides consistent confirmation gates for destructive commands: interactive y/N (or type-to-confirm) on a terminal, and a required --force flag when running non-interactively so scripts fail safe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAborted = errors.New("aborted")
ErrAborted is returned when the user declines a confirmation.
Functions ¶
func Ask ¶
Ask prompts on a TTY for a line of text, showing def as the default. It returns def when the user presses enter on an empty line, or immediately (no prompt) when stdin is not a terminal — so non-interactive runs use defaults.
func AskSecret ¶
AskSecret prompts on a TTY for a secret without echoing it (via term.ReadPassword), so tokens never appear on screen or in scrollback. It returns "" when stdin is not a terminal — non-interactive runs should supply secrets via flags or stdin, not this prompt.
Types ¶
This section is empty.