summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/cheggaaa/pb.v1/pool_x.go
blob: d95b71d8762086007bdc637f3f5b6135d96788c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// +build linux darwin freebsd netbsd openbsd solaris dragonfly

package pb

import "fmt"

func (p *Pool) print(first bool) bool {
	var out string
	if !first {
		out = fmt.Sprintf("\033[%dA", len(p.bars))
	}
	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
}