summaryrefslogtreecommitdiff
path: root/internal/progress
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-12-27 18:04:11 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-12-27 18:04:11 -0500
commit68ba0d4a215f8c99649779e71cd9ff31eb210edc (patch)
treea9907f15d5b6dffabd9a6ed3fb310072989f8fc1 /internal/progress
parent3b8fa0766a0050c0dd026be5d6a1ce2827956530 (diff)
Fix BinaryFill Example
Diffstat (limited to 'internal/progress')
-rw-r--r--internal/progress/progress.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/progress/progress.go b/internal/progress/progress.go
index 9a3b37e..c6caade 100644
--- a/internal/progress/progress.go
+++ b/internal/progress/progress.go
@@ -107,6 +107,18 @@ func WithFillCharacters(steps []FillStep) Option {
}
}
+// WithBinaryFill results in a less granular but possible more widely compatible
+// progress bar as only two characters are used to represent completion of a
+// single block (full/complete and empty/incomplete).
+func WithBinaryFill() Option {
+ return func(m *Model) {
+ m.FillSteps = []FillStep{
+ {' ', 0.0},
+ {'█', 1.0},
+ }
+ }
+}
+
// WithoutPercentage hides the numeric percentage.
func WithoutPercentage() Option {
return func(m *Model) {