ux

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogPlainText bool

LogPlainText disables spinners and uses plain logger output when true. Set before using any ux functions (e.g. when not a TTY or in CI).

View Source
var Verbose bool

Verbose enables streaming of build output to stdout instead of suppressing it. Implies LogPlainText. Set by --debug.

Functions

func GetConfirmation

func GetConfirmation(message string) (bool, error)

GetConfirmation shows an interactive confirmation prompt (defaults to true).

func GetSelection added in v0.3.0

func GetSelection(message string, options []string) (string, error)

GetSelection shows an interactive selection prompt and returns the chosen option.

func Println

func Println(message string)

Println prints a styled line (or plain info when LogPlainText is set).

Types

type ProgressSpinner

type ProgressSpinner struct {
	// contains filtered or unexported fields
}

ProgressSpinner wraps pterm.SpinnerPrinter with a plain-text fallback.

func NewProgressSpinner

func NewProgressSpinner(message string) *ProgressSpinner

NewProgressSpinner creates and starts a spinner, or logs the message if in plain-text mode.

func (*ProgressSpinner) Fail

func (ps *ProgressSpinner) Fail(message string) *ProgressSpinner

Fail marks the spinner as failed.

func (*ProgressSpinner) Stop

func (ps *ProgressSpinner) Stop()

Stop clears the spinner without leaving any output.

func (*ProgressSpinner) Success

func (ps *ProgressSpinner) Success(message string) *ProgressSpinner

Success marks the spinner as successful.

func (*ProgressSpinner) UpdateText

func (ps *ProgressSpinner) UpdateText(message string) *ProgressSpinner

UpdateText updates the spinner text or prints the message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL