@@ -882,17 +882,19 @@ (define (no-arguments arg _)
(N_ "Building from this channel:~%"
"Building from these channels:~%"
(length instances)))
- (for-each (lambda (instance)
- (let ((channel
- (channel-instance-channel instance)))
- (format (current-error-port)
- " ~10a~a\t~a~%"
- (channel-name channel)
- (channel-url channel)
- (string-take
- (channel-instance-commit instance)
- 7))))
- instances)
+ (pretty-print-table
+ (map-in-order (lambda (instance)
+ (let ((channel
+ (channel-instance-channel instance)))
+ (list (symbol->string (channel-name channel))
+ (channel-url channel)
+ (string-take
+ (channel-instance-commit instance)
+ 7))))
+ instances)
+ #:max-column-width 100 ;; URLs can be long.
+ #:left-pad 2
+ #:output (current-error-port))
(parameterize ((%guile-for-build
(package-derivation
store
@@ -1192,7 +1192,7 @@ (define* (string-closest trial tests #:key (threshold 3))
;;; Prettified output.
;;;
-(define* (pretty-print-table rows #:key (max-column-width 20) (left-pad 0))
+(define* (pretty-print-table rows #:key (max-column-width 20) (left-pad 0) (output #t))
"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
@@ -1211,7 +1211,7 @@ (define* (pretty-print-table rows #:key (max-column-width 20) (left-pad 0))
(map (cut min <> max-column-width)
column-widths)))
(fmt (string-append (string-join column-formats "\t") "\t~a")))
- (for-each (cut format #t "~v_~?~%" left-pad fmt <>) rows)))
+ (for-each (cut format output "~v_~?~%" left-pad fmt <>) rows)))
;;; Local Variables:
;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1)