Skip to content

Commit 787de03

Browse files
committed
add ascii theme from #203
1 parent 0e8db3d commit 787de03

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/theme-ascii/main.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"time"
5+
6+
"github.com/schollz/progressbar/v3"
7+
)
8+
9+
func main() {
10+
bar := progressbar.NewOptions(100,
11+
progressbar.OptionUseANSICodes(false),
12+
progressbar.OptionEnableColorCodes(true),
13+
progressbar.OptionShowIts(),
14+
progressbar.OptionSetTheme(progressbar.ThemeASCII),
15+
progressbar.OptionShowElapsedTimeOnFinish(),
16+
)
17+
18+
for i := 0; i < 100; i++ {
19+
bar.Add(1)
20+
time.Sleep(40 * time.Millisecond)
21+
}
22+
}

0 commit comments

Comments
 (0)