mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 10:36:12 +00:00
Make progress bars look nicer
This commit is contained in:
@@ -76,6 +76,15 @@ func createProgressBar(max int64, description string, hideBar bool) *progressbar
|
||||
output = os.Stderr
|
||||
}
|
||||
|
||||
if len(description) < 40 {
|
||||
for i := len(description); i < 40; i++ {
|
||||
description += " "
|
||||
}
|
||||
}
|
||||
if len(description) > 40 {
|
||||
description = description[:len(description)-5] + "..."
|
||||
}
|
||||
|
||||
return progressbar.NewOptions64(max,
|
||||
progressbar.OptionSetDescription(description),
|
||||
progressbar.OptionSetWriter(output),
|
||||
|
||||
Reference in New Issue
Block a user