Skip to content

Commit dbcce75

Browse files
committed
Add toggle for keeping or cleaning progress
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 5e40437 commit dbcce75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/start/start.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ func ShowProgress(inst *store.Instance, progress Progress) {
301301
// Same as pb.Simple, but don't show the `{{percent . }}`
302302
const tmpl = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{with string . "suffix"}} {{.}}{{end}}`
303303

304+
// Keep the old progress bar showing, or clean on finish
305+
const keep = true
306+
304307
func ShowRequirement(inst *store.Instance, req hostagentevents.Requirement) {
305308
if !OutputProgress {
306309
return
@@ -311,8 +314,9 @@ func ShowRequirement(inst *store.Instance, req hostagentevents.Requirement) {
311314
pb.RegisterElement("bar", pb.ElementBar, false)
312315
ProgressBar.SetTemplateString(tmpl)
313316
ProgressBar.SetWidth(100) // with longest suffix
317+
ProgressBar.Set(pb.CleanOnFinish, !keep)
314318
ProgressBar.Set("prefix", "Waiting")
315-
} else {
319+
} else if keep {
316320
// Flush the progress bar output for this line
317321
ProgressBar.Finish()
318322
ProgressBar.Start()

0 commit comments

Comments
 (0)