vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

Set bar-text dynamically after completing #71

Closed JojiiOfficial closed 4 years ago

JojiiOfficial commented 4 years ago

Is it possible to set the text of the progressbar after calling the "AddBar" func? Lets assume I want to upload a file. After uploading I receive data from a server where the file was uploaded to. How can I set the "OnComplete" text of the bar dynamically after the file is uploaded?

vbauerster commented 4 years ago

Progress bar is structured like this:

[Decorator1..DecoratorN] [BarFiller] [Decorator1..DecoratorN]

To replace BarFiller with some string on completion, use BarFillerOnComplete option. If you need something more advanced use BarFillerMiddleware option.

For decorators there is similar option named decor.OnComplete.

JojiiOfficial commented 4 years ago

Exactly what I was looking for. Thank you!