Documentation ¶
Overview ¶
Package spin provides a shell script interface for the spinner bubble. https://github.com/charmbracelet/bubbles/tree/master/spinner
It is useful for displaying that some task is running in the background while consuming it's output so that it is not shown to the user.
For example, let's do a long running task: $ sleep 5
We can simply prepend a spinner to this task to show it to the user, while performing the task / command in the background.
$ gum spin -t "Taking a nap..." -- sleep 5
The spinner will automatically exit when the task is complete.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Command []string `arg:"" help:"Command to run"` ShowOutput bool `help:"Show or pipe output of command during execution" default:"false" env:"GUM_SPIN_SHOW_OUTPUT"` Spinner string `` /* 157-byte string literal not displayed */ SpinnerStyle style.Styles `embed:"" prefix:"spinner." set:"defaultForeground=212" envprefix:"GUM_SPIN_SPINNER_"` Title string `help:"Text to display to user while spinning" default:"Loading..." env:"GUM_SPIN_TITLE"` TitleStyle style.Styles `embed:"" prefix:"title." envprefix:"GUM_SPIN_TITLE_"` Align string `` /* 129-byte string literal not displayed */ Timeout time.Duration `help:"Timeout until spin command aborts" default:"0" env:"GUM_SPIN_TIMEOUT"` }
Options is the customization options for the spin command.
func (Options) BeforeReset ¶
BeforeReset hook. Used to unclutter style flags.
func (Options) Run ¶
Run provides a shell script interface for the spinner bubble. https://github.com/charmbracelet/bubbles/spinner