Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskYesNo ¶
AskYesNo asks question on w and reads a yes/no response from r. AssumeYes short-circuits to true; NonInteractive (without AssumeYes) short-circuits to false. Default (empty answer) is no. Recognises: y, yes (case-insensitive, trimmed).
func ColorEnabled ¶
ColorEnabled reports whether color/ANSI escapes should be emitted to w.
- ColorNever or NO_COLOR/COMMITBRIEF_NO_COLOR env set → false
- ColorAlways → true (caller's choice, even when piped)
- ColorAuto → true only if w is a TTY
func EnableANSI ¶
EnableANSI applies platform-specific tweaks needed to render ANSI escapes (e.g. enabling VT processing on Windows 10+). No-op on POSIX.
func IsStdinTTY ¶
IsStdinTTY reports whether the given reader is a TTY. Used by the CLI to decide whether to set AskOptions.NonInteractive automatically.
Types ¶
type AskOptions ¶
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
func NewSpinner ¶
NewSpinner returns a spinner that animates frames in w. When the writer is not a TTY (or NO_COLOR-equivalent is set), the spinner is inert: Start does nothing, Stop does nothing. Callers don't need to branch on TTY state.
type StreamResult ¶
StreamResult is the accumulated outcome of draining a provider stream. Content is the full assembled response; Usage is the last reported usage (may be the cumulative final value); Err is non-nil on a stream error.