Skip to content

Commit 736252b

Browse files
committed
fix progress bar - will display one progress bar per database
1 parent e41b405 commit 736252b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ func drawProgressBar(to io.Writer, currentPosition, nElements, widgetSize int) {
2222
bars := strings.Repeat("=", nBars)
2323
spaces := strings.Repeat(" ", widgetSize-nBars)
2424
fmt.Fprintf(to, "\r[%s%s] %3d%% [%d/%d]", bars, spaces, int(percent), currentPosition, nElements)
25+
26+
if currentPosition == nElements {
27+
fmt.Fprint(to, "\n")
28+
}
2529
}
2630

2731
func isFlagPassed(name string) bool {
@@ -72,9 +76,6 @@ func realMain() int {
7276
defer func() {
7377
close(progressNotifs)
7478
wg.Wait()
75-
if !(*silent) {
76-
fmt.Fprint(os.Stderr, "\n")
77-
}
7879
}()
7980

8081
go func() {

0 commit comments

Comments
 (0)