mirror of
https://github.com/charmbracelet/gum
synced 2024-06-16 12:35:06 +02:00
454040cf4d
Spin provides a shell script interface for the spinner bubble. 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.
18 lines
434 B
Go
18 lines
434 B
Go
package spin
|
|
|
|
import "github.com/charmbracelet/bubbles/spinner"
|
|
|
|
var spinnerMap = map[string]spinner.Spinner{
|
|
"line": spinner.Line,
|
|
"dot": spinner.Dot,
|
|
"minidot": spinner.MiniDot,
|
|
"jump": spinner.Jump,
|
|
"pulse": spinner.Pulse,
|
|
"points": spinner.Points,
|
|
"globe": spinner.Globe,
|
|
"moon": spinner.Moon,
|
|
"monkey": spinner.Monkey,
|
|
"meter": spinner.Meter,
|
|
"hamburger": spinner.Hamburger,
|
|
}
|