Documentation
¶
Index ¶
- Constants
- func Err(w io.Writer, msg string) string
- func Header(w io.Writer, title string)
- func HelpLong() string
- func Info(w io.Writer, msg string) string
- func Success(w io.Writer, msg string) string
- func VersionTemplate() string
- func Warn(w io.Writer, msg string) string
- type Progress
- type Step
- type StepFn
Constants ¶
const CatchPhrase = "Every release deserves a héraut."
CatchPhrase is the tagline displayed under the logo.
Variables ¶
This section is empty.
Functions ¶
func Header ¶ added in v0.9.0
Header writes a bold section title to w, surrounded by blank lines. Used to separate config / runtime / cliff sections in heraut check.
func HelpLong ¶
func HelpLong() string
HelpLong returns the ASCII art + tagline for use as cobra root.Long.
func Info ¶ added in v0.8.0
Info returns " <msg>" dimmed when w supports color, plain otherwise. Use for hints and supplementary context below a primary status line.
func Success ¶ added in v0.8.0
Success returns "✓ <msg>" styled green when w supports color, plain otherwise.
func VersionTemplate ¶
func VersionTemplate() string
VersionTemplate returns a cobra text/template string for --version output. cobra fills {{.Name}} and {{.Version}} at runtime.
Types ¶
type Progress ¶ added in v0.11.0
type Progress struct {
// contains filtered or unexported fields
}
Progress runs a sequence of named pipeline steps, labelling each one with a N/total counter and an animated spinner in TTY environments.
Non-TTY writers (CI, pipes, dry-run) automatically fall back to plain lines through the existing StartStep → StartPlainStep detection in step.go.
func NewProgress ¶ added in v0.11.0
NewProgress constructs a Progress that writes to out and labels each step N/total. total may be 0 when the caller cannot pre-compute the count; steps then render as N/0, which is a degraded-but-non-crashing state.
type Step ¶ added in v0.9.0
type Step struct {
// contains filtered or unexported fields
}
Step represents a single named check or pipeline step. In TTY environments it shows an animated spinner while the work runs, then replaces it with a final status line. In non-TTY (CI, pipe, dry-run) it falls back to plain text so log files stay readable.
func StartPlainStep ¶ added in v0.9.0
StartPlainStep always uses plain lines regardless of terminal. Use in dry-run mode where output lines must not be overwritten by the spinner.
func StartStep ¶ added in v0.9.0
StartStep begins a step with automatic TTY detection. Animates a spinner when the writer is a terminal, falls back to plain text otherwise.
func (*Step) Done ¶ added in v0.9.0
Done completes the step successfully. Prints "✓ step name — result" (or "✓ step name" when result is empty).
type StepFn ¶ added in v0.11.0
StepFn is the type of a function that wraps one named pipeline step. name is shown while the step is running and on the completion line. fn performs the work. It returns:
- result: shown as "✓ N/M name — result" when non-empty; omitted otherwise
- subs: zero or more sub-result labels, each printed as an indented " ✓ label" line beneath the parent completion line
- err: step failure; the reporter renders "✗ N/M name — err"
When the StepFn field on a pipeline is nil, the pipeline calls fn directly and discards result and subs — existing behaviour preserved, tests unaffected.