summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go')
-rw-r--r--vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go b/vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go
new file mode 100644
index 000000000..d7a5ace41
--- /dev/null
+++ b/vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go
@@ -0,0 +1,35 @@
+// +build windows
+
+package pb
+
+import (
+ "fmt"
+ "log"
+)
+
+func (p *Pool) print(first bool) bool {
+ var out string
+ if !first {
+ coords, err := getCursorPos()
+ if err != nil {
+ log.Panic(err)
+ }
+ coords.Y -= int16(len(p.bars))
+ coords.X = 0
+
+ err = setCursorPos(coords)
+ if err != nil {
+ log.Panic(err)
+ }
+ }
+ isFinished := true
+ for _, bar := range p.bars {
+ if !bar.isFinish {
+ isFinished = false
+ }
+ bar.Update()
+ out += fmt.Sprintf("\r%s\n", bar.String())
+ }
+ fmt.Print(out)
+ return isFinished
+}