Skip to content

Commit

Permalink
updated docs (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
sha1n authored Jun 1, 2021
1 parent af157d2 commit eae5f2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ go get github.com/sha1n/termite
## Examples
### Spinner
```go
terminal := termite.NewTerminal(true)
refreshInterval := time.Millisecond * 100
spinner := termite.NewSpinner(terminal, "Processing...", refreshInterval)
spinner := termite.NewSpinner(termite.StdoutWriter, "Processing...", refreshInterval, termite.DefaultSpinnerFormatter())

if _, e := spinner.Start(); e == nil {
doWork()
Expand All @@ -41,8 +40,8 @@ if _, e := spinner.Start(); e == nil {

### Progress Bar
```go
terminal := termite.NewTerminal(true)
progressBar := termite.NewDefaultProgressBar(terminal, workItems)
termWidth, _, _ := termite.GetTerminalDimensions()
progressBar := termite.NewProgressBar(termite.StdoutWriter, tickCount, width, termWidth, termite.DefaultProgressBarFormatter())

if tick, cancel, err := progressBar.Start(); err == nil {
defer cancel()
Expand Down
Binary file modified docs/images/termite_demo_800.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eae5f2d

Please sign in to comment.