Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mbrlabs/clispin

Wrap your functions in fancy cli spinners
https://github.com/mbrlabs/clispin

cli go golang loading progress spinner statusbar terminal

Last synced: about 2 months ago
JSON representation

Wrap your functions in fancy cli spinners

Awesome Lists containing this project

README

        





Travis status


Godoc

# clispin
Clispin is a Go library, that makes it ridiculously easy to integrate fancy unicode spinners in your app.

## Usage
```go
spinner := clispin.New(nil)
spinner.Start(func() {
// Do your work here. Update spinner text with Print or Printf
spinner.Printf("Downloading file %d/2", 1)
time.Sleep(time.Second)
spinner.Printf("Downloading file %d/2", 2)
time.Sleep(time.Second)

spinner.Print("Processing files")
time.Sleep(time.Second)
spinner.Print("Done")
})
```

```clispin.New()``` creates a new spinner. You can pass in a ```Sprite``` struct to customize the spinner
animation. If no sprite is provided, a default one is chosen.

There are also a couple of [sprites](https://github.com/mbrlabs/clispin/blob/master/sprite.go) included in this library.