gum/spin/spinners.go
Maas Lalani 454040cf4d
feat: Add gum spin command
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.
2022-07-07 13:29:10 -04:00

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,
}