Make progress bars look nicer

This commit is contained in:
2025-10-29 18:38:52 +02:00
parent b27e9fb0df
commit b2fc963389
+9
View File
@@ -76,6 +76,15 @@ func createProgressBar(max int64, description string, hideBar bool) *progressbar
output = os.Stderr 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, return progressbar.NewOptions64(max,
progressbar.OptionSetDescription(description), progressbar.OptionSetDescription(description),
progressbar.OptionSetWriter(output), progressbar.OptionSetWriter(output),