Codebase list golang-github-vbauerster-mpb / 59d31df
use ansi colored string in decorator Vladimir Bauer 6 years ago
1 changed file(s) with 3 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
4343 i := i
4444 go func() {
4545 task := fmt.Sprintf("Task#%02d:", i)
46 job := "installing"
46 job := "\x1b[31;1;4minstalling\x1b[0m"
4747 // preparing delayed bars
4848 b := p.AddBar(rand.Int63n(101)+100,
4949 mpb.BarParkTo(bars[i]),
5151 mpb.PrependDecorators(
5252 decor.Name(task, decor.WC{W: len(task) + 1, C: decor.DidentRight}),
5353 decor.OnComplete(decor.Name(job, decor.WCSyncSpaceR), "done!"),
54 decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_MMSS, 0, decor.WCSyncWidth), "")),
54 decor.OnComplete(decor.EwmaETA(decor.ET_STYLE_MMSS, 0, decor.WCSyncWidth), ""),
55 ),
5556 mpb.AppendDecorators(
5657 decor.OnComplete(decor.Percentage(decor.WC{W: 5}), ""),
5758 ),