Add ANSI styles.

This commit is contained in:
Dominik Pantůček 2023-03-18 14:04:12 +01:00
parent e6d383b020
commit fcf9b57f8d
3 changed files with 16 additions and 2 deletions

View file

@ -29,6 +29,12 @@
ansi
(
ansi
a:error
a:warning
a:success
a:neutral
a:default
a:muted
ansi-tests!
)
@ -66,6 +72,14 @@
(string-intersperse argsl ";")
"m"))))
;; Nice styles to be used everywhere for consistency
(define a:error (ansi #:red #:bold))
(define a:warning (ansi #:default #:yellow))
(define a:success (ansi #:green #:bold))
(define a:neutral (ansi #:default #:white))
(define a:default (ansi #:default))
(define a:muted (ansi #:black #:bold))
;; Performs ANSI module self-tests.
(define (ansi-tests!)
(run-tests

View file

@ -36,7 +36,7 @@
primes)
;; Print banner
(print "brmsaptool 0.2 (c) 2023 Brmlab, z.s.")
(print "brmsaptool 0.3 (c) 2023 Brmlab, z.s.")
(newline)
;; Run tests

View file

@ -96,7 +96,7 @@
(newline)
(print-source-listing lines highlights
(*member-file-context*)
(ansi #:red #:bold) (ansi #:default)
a:error a:default
"" "" "..."))
(if (eq? (*member-file-check-syntax*) 'error)
(exit 1)