[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/09: progress: 'progress-bar' accounts for brackets.
From: |
Ludovic Courtès |
Subject: |
02/09: progress: 'progress-bar' accounts for brackets. |
Date: |
Fri, 1 Dec 2017 10:00:38 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 5ed534ccc352cea9fd7920e820c8e5f47ea456ba
Author: Ludovic Courtès <address@hidden>
Date: Wed Nov 22 14:36:20 2017 +0100
progress: 'progress-bar' accounts for brackets.
* guix/progress.scm (progress-bar): Subtract 2 to BAR-WIDTH to account
for brackets.
---
guix/progress.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/guix/progress.scm b/guix/progress.scm
index 1993c74..ba79442 100644
--- a/guix/progress.scm
+++ b/guix/progress.scm
@@ -146,7 +146,8 @@ INTERVAL (a time-duration object), otherwise does nothing
and returns #f."
(define* (progress-bar % #:optional (bar-width 20))
"Return % as a string representing an ASCII-art progress bar. The total
width of the bar is BAR-WIDTH."
- (let* ((fraction (/ % 100))
+ (let* ((bar-width (max 3 (- bar-width 2)))
+ (fraction (/ % 100))
(filled (inexact->exact (floor (* fraction bar-width))))
(empty (- bar-width filled)))
(format #f "[~a~a]"
- branch master updated (e695d79 -> c7ffbfe), Ludovic Courtès, 2017/12/01
- 01/09: progress: Factorize erase-in-line., Ludovic Courtès, 2017/12/01
- 02/09: progress: 'progress-bar' accounts for brackets.,
Ludovic Courtès <=
- 03/09: progress: Add 'progress-reporter/bar'., Ludovic Courtès, 2017/12/01
- 05/09: guix system: Simplify closure copy., Ludovic Courtès, 2017/12/01
- 09/09: gnu: guile: Add version 2.2.3., Ludovic Courtès, 2017/12/01
- 04/09: weather: Use (guix progress) for progress report., Ludovic Courtès, 2017/12/01
- 08/09: gnu: gnome-default-applications: Add Evince for PDF and PS., Ludovic Courtès, 2017/12/01
- 07/09: services: xorg: Add 'font-misc-misc' to the default font set., Ludovic Courtès, 2017/12/01
- 06/09: guix system: 'init' displays a progress bar while copying., Ludovic Courtès, 2017/12/01