Skip to content

Commit

Permalink
Merge pull request #436 from pterm/351-make-progressbar-start-accept-…
Browse files Browse the repository at this point in the history
…a-title-like-spinner
  • Loading branch information
MarvinJWendt committed Jan 5, 2023
2 parents 07d6770 + beec9d1 commit 4a64f8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion progressbar_printer.go
Expand Up @@ -257,11 +257,14 @@ func (p *ProgressbarPrinter) Add(count int) *ProgressbarPrinter {
}

// Start the ProgressbarPrinter.
func (p ProgressbarPrinter) Start() (*ProgressbarPrinter, error) {
func (p ProgressbarPrinter) Start(title ...interface{}) (*ProgressbarPrinter, error) {
if RawOutput && p.ShowTitle {
Fprintln(p.Writer, p.Title)
}
p.IsActive = true
if len(title) != 0 {
p.Title = Sprint(title...)
}
ActiveProgressBarPrinters = append(ActiveProgressBarPrinters, &p)
p.startedAt = time.Now()

Expand Down

0 comments on commit 4a64f8c

Please sign in to comment.