Skip to content

Commit

Permalink
feat(progress): added template update option
Browse files Browse the repository at this point in the history
  • Loading branch information
snakeice committed Jul 18, 2020
1 parent ffa9e74 commit 5d29b69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,11 @@ func (pb *Progress) NewProxyWriter(r io.Writer) *Writer {
pb.Units = format.U_BYTES
return &Writer{r, pb}
}

func (pb *Progress) SetTemplate(template string) {
pb.frameParser.UpdateTemplate(template)
}

func (pb *Progress) ResetTemplate() {
pb.frameParser.UpdateTemplate(DefaultTemplate)
}

0 comments on commit 5d29b69

Please sign in to comment.