diff --git a/progress.go b/progress.go index fb66ce0..c4ff136 100644 --- a/progress.go +++ b/progress.go @@ -106,7 +106,7 @@ } // Add creates a bar which renders itself by provided filler. -// Set total to 0, if you plan to update it later. +// If `total <= 0` trigger complete event is disabled until reset with *bar.SetTotal(int64, bool). // Panics if *Progress instance is done, i.e. called after *Progress.Wait(). func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) *Bar { if filler == nil { @@ -349,6 +349,10 @@ debugOut: s.debugOut, } + if total > 0 { + bs.triggerComplete = true + } + for _, opt := range options { if opt != nil { opt(bs)