Skip to content

Commit bdf9650

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

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
@@ -326,6 +326,9 @@ func ShowProgress(inst *store.Instance, progress Progress) {
326326
// Same as pb.Simple, but don't show the `{{percent . }}`
327327
const tmpl = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{with string . "suffix"}} {{.}}{{end}}`
328328

329+
// Keep the old progress bar showing, or clean on finish
330+
const keep = true
331+
329332
func ShowRequirement(_ *store.Instance, req hostagentevents.Requirement) {
330333
if !OutputProgress {
331334
return
@@ -336,8 +339,9 @@ func ShowRequirement(_ *store.Instance, req hostagentevents.Requirement) {
336339
pb.RegisterElement("bar", pb.ElementBar, false)
337340
ProgressBar.SetTemplateString(tmpl)
338341
ProgressBar.SetWidth(100) // with longest suffix
342+
ProgressBar.Set(pb.CleanOnFinish, !keep)
339343
ProgressBar.Set("prefix", "Waiting")
340-
} else {
344+
} else if keep {
341345
// Flush the progress bar output for this line
342346
ProgressBar.Finish()
343347
ProgressBar.Start()

0 commit comments

Comments
 (0)