aboutsummaryrefslogtreecommitdiff
path: root/guix/utils.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-07-22 01:09:14 +0200
committerMarius Bakke <marius@gnu.org>2022-07-22 01:09:14 +0200
commit9044b086ddca64a62966a83cbf1b82d32dece89e (patch)
tree2c7f910c9100b2f2a752d07fe0ec44be83fb7600 /guix/utils.scm
parent5dfc6ab1ab292b87ceea144aa661d0e64c834031 (diff)
parentabea091dbef2d44e6eb46bd2413bdf917e14d095 (diff)
downloadguix-9044b086ddca64a62966a83cbf1b82d32dece89e.tar
guix-9044b086ddca64a62966a83cbf1b82d32dece89e.tar.gz
Merge branch 'staging' into core-updates
Diffstat (limited to 'guix/utils.scm')
-rw-r--r--guix/utils.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index ca4fecebc8..9b277a0092 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -1116,11 +1116,11 @@ according to THRESHOLD, then #f is returned."
;;; Prettified output.
;;;
-(define* (pretty-print-table rows #:key (max-column-width 20))
+(define* (pretty-print-table rows #:key (max-column-width 20) (left-pad 0))
"Print ROWS in neat columns. All rows should be lists of strings and each
row should have the same length. The columns are separated by a tab
character, and aligned using spaces. The maximum width of each column is
-bound by MAX-COLUMN-WIDTH."
+bound by MAX-COLUMN-WIDTH. Each row is prefixed with LEFT-PAD spaces."
(let* ((number-of-columns-to-pad (if (null? rows)
0
(1- (length (first rows)))))
@@ -1135,7 +1135,7 @@ bound by MAX-COLUMN-WIDTH."
(map (cut min <> max-column-width)
column-widths)))
(fmt (string-append (string-join column-formats "\t") "\t~a")))
- (for-each (cut format #t "~?~%" fmt <>) rows)))
+ (for-each (cut format #t "~v_~?~%" left-pad fmt <>) rows)))
;;; Local Variables:
;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1)