Documentation
¶
Index ¶
- Constants
- func BoldText(s string) string
- func Bullet(style, msg string)
- func ColorText(code, s string) string
- func Confirm(prompt string, autoYes bool) bool
- func ConfirmInteractive(prompt, note string, autoYes bool) bool
- func Create(msg string)
- func DimText(s string) string
- func DryRun(msg string)
- func Error(msg string)
- func Errorf(format string, args ...interface{})
- func Header(title string)
- func Info(msg string)
- func InfoBox(title string, lines ...string)
- func PreviewSection(title string, items ...string)
- func Section(label string)
- func Skip(msg string)
- func StdinIsInteractive() bool
- func Step(msg string)
- func StepN(n, total int, msg string)
- func Success(msg string)
- func SuccessBox(msg string, nextSteps ...string)
- func Warn(msg string)
- func WarnBox(title string, lines ...string)
Constants ¶
const ( Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Cyan = "\033[36m" White = "\033[37m" )
ANSI color codes
const ThreeStringPlaceHolder = "\n%s%s%s\n"
Variables ¶
This section is empty.
Functions ¶
func Bullet ¶
func Bullet(style, msg string)
Bullet prints a status bullet.
style: "ok", "warn", "error", "skip", "none", "found", "dry"
func Confirm ¶
Confirm prompts the user for yes/no confirmation. Returns true if the user confirms (y/Y/yes), false otherwise. If autoYes is true, it auto-confirms without prompting.
func ConfirmInteractive ¶
ConfirmInteractive is Confirm for prompts that must never block when no human is present. Under autoYes it auto-confirms; on a real terminal it prompts; otherwise (CI, `da refresh`, redirected/piped stdin) it returns false without reading, so the caller's safe default applies. note, when non-interactive, is logged so the skip is visible.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf prints a formatted error to stderr.
func PreviewSection ¶
PreviewSection prints a labeled list of preview items.
func StdinIsInteractive ¶
func StdinIsInteractive() bool
StdinIsInteractive reports whether stdin is connected to a terminal. Callers use it to avoid blocking on an interactive prompt when running non-interactively (CI, `da refresh`, piped/redirected input), where they should fall back to a deterministic default instead.
func SuccessBox ¶
SuccessBox prints a success message with next steps.
Types ¶
This section is empty.