diff --git a/bar_filler.go b/bar_filler.go index 32d51c0..c8cedaa 100644 --- a/bar_filler.go +++ b/bar_filler.go @@ -9,13 +9,14 @@ // BarFiller interface. // Bar (without decorators) renders itself by calling BarFiller's Fill method. // -// `reqWidth` is requested width, which is set via: -// func WithWidth(width int) ContainerOption -// func BarWidth(width int) BarOption +// reqWidth is requested width, set by `func WithWidth(int) ContainerOption`. +// If not set, it defaults to terminal width. // // Default implementations can be obtained via: // // func NewBarFiller(style string) BarFiller +// func NewBarFillerRev(style string) BarFiller +// func NewBarFillerPick(style string, rev bool) BarFiller // func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller // type BarFiller interface { diff --git a/bar_option.go b/bar_option.go index 5aa1219..d26c0b2 100644 --- a/bar_option.go +++ b/bar_option.go @@ -8,7 +8,7 @@ "github.com/vbauerster/mpb/v6/internal" ) -// BarOption is a function option which changes the default behavior of a bar. +// BarOption is a func option to alter default behavior of a bar. type BarOption func(*bState) func (s *bState) addDecorators(dest *[]decor.Decorator, decorators ...decor.Decorator) { diff --git a/container_option.go b/container_option.go index ab8cb2d..b92c757 100644 --- a/container_option.go +++ b/container_option.go @@ -9,8 +9,9 @@ "github.com/vbauerster/mpb/v6/internal" ) -// ContainerOption is a function option which changes the default -// behavior of progress container, if passed to mpb.New(...ContainerOption). +// ContainerOption is a func option to alter default behavior of a bar +// container. Container term refers to a Progress struct which can +// hold one or more Bars. type ContainerOption func(*pState) // WithWaitGroup provides means to have a single joint point. If @@ -23,8 +24,9 @@ } } -// WithWidth sets container width. If not set underlying bars will -// occupy whole term width. +// WithWidth sets container width. If not set it defaults to terminal +// width. A bar added to the container will inherit its width, unless +// overridden by `func BarWidth(int) BarOption`. func WithWidth(width int) ContainerOption { return func(s *pState) { s.reqWidth = width