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 `` /* 128-byte string literal not displayed */
ShowError bool `help:"Show output of command only if the command fails" default:"false" env:"GUM_SPIN_SHOW_ERROR"`
ShowStdout bool `help:"Show STDOUT output" default:"false" env:"GUM_SPIN_SHOW_STDOUT"`
ShowStderr bool `help:"Show STDERR errput" default:"false" env:"GUM_SPIN_SHOW_STDERR"`
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:"0s" env:"GUM_SPIN_TIMEOUT"`
Padding string `help:"Padding" default:"${defaultPadding}" group:"Style Flags" env:"GUM_SPIN_PADDING"`
}
Options is the customization options for the spin command.
func (Options) Run ¶
Run provides a shell script interface for the spinner bubble. https://github.com/charmbracelet/bubbles/spinner