From 787de03c235c25aae5c550d3c1af550cac74ad6d Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 3 Oct 2024 12:01:11 -0700 Subject: [PATCH] add ascii theme from #203 --- examples/theme-ascii/main.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/theme-ascii/main.go diff --git a/examples/theme-ascii/main.go b/examples/theme-ascii/main.go new file mode 100644 index 0000000..ad3d3bb --- /dev/null +++ b/examples/theme-ascii/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "time" + + "github.com/schollz/progressbar/v3" +) + +func main() { + bar := progressbar.NewOptions(100, + progressbar.OptionUseANSICodes(false), + progressbar.OptionEnableColorCodes(true), + progressbar.OptionShowIts(), + progressbar.OptionSetTheme(progressbar.ThemeASCII), + progressbar.OptionShowElapsedTimeOnFinish(), + ) + + for i := 0; i < 100; i++ { + bar.Add(1) + time.Sleep(40 * time.Millisecond) + } +}