mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
colors: Introduce a disjoint type and pre-compute ANSI escapes.
* guix/colors.scm (color-table, color): Remove. (<color>): New record type. (print-color): New procedure. (define-color-table, color): New macros. (color-codes->ansi): New procedure. (%reset): New variable. (colorize-string): Rewrite accordingly. (color-rules): Adjust accordingly. * guix/status.scm (print-build-event): Adjust to new 'colorize-string' interface. * guix/ui.scm (%highlight-argument): Likewise. (%warning-colors, %info-colors, %error-colors, %hint-colors) (%highlight-colors): Remove. (%warning-color, %info-color, %error-color, %hint-color) (%highlight-color): New variables.
This commit is contained in:
parent
c1df77e215
commit
2569ef9dab
3 changed files with 101 additions and 65 deletions
|
@ -410,17 +410,17 @@ produce colorful output. When PRINT-LOG? is true, display the build log in
|
|||
addition to build events."
|
||||
(define info
|
||||
(if colorize?
|
||||
(cut colorize-string <> 'BOLD)
|
||||
(cute colorize-string <> (color BOLD))
|
||||
identity))
|
||||
|
||||
(define success
|
||||
(if colorize?
|
||||
(cut colorize-string <> 'GREEN 'BOLD)
|
||||
(cute colorize-string <> (color GREEN BOLD))
|
||||
identity))
|
||||
|
||||
(define failure
|
||||
(if colorize?
|
||||
(cut colorize-string <> 'RED 'BOLD)
|
||||
(cute colorize-string <> (color RED BOLD))
|
||||
identity))
|
||||
|
||||
(define (report-build-progress phase %)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue