refactoring: AddBar AddSpinner
Vladimir Bauer
5 years ago
| 101 | 101 | // AddBar creates a bar with default bar filler. Different filler can |
| 102 | 102 | // be choosen and applied via `*Progress.Add(...) *Bar` method. |
| 103 | 103 | func (p *Progress) AddBar(total int64, options ...BarOption) *Bar { |
| 104 | return p.Add(total, NewBarFiller(BarDefaultStyle), options...) | |
| 104 | return p.Add(total, NewBarFiller(BarStyle()), options...) | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // AddSpinner creates a bar with default spinner filler. Different |
| 108 | 108 | // filler can be choosen and applied via `*Progress.Add(...) *Bar` |
| 109 | 109 | // method. |
| 110 | func (p *Progress) AddSpinner(total int64, alignment SpinnerAlignment, options ...BarOption) *Bar { | |
| 111 | return p.Add(total, NewSpinnerFiller(SpinnerDefaultStyle, alignment), options...) | |
| 110 | func (p *Progress) AddSpinner(total int64, options ...BarOption) *Bar { | |
| 111 | return p.Add(total, NewBarFiller(SpinnerStyle()), options...) | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // Add creates a bar which renders itself by provided filler. |