Add ANSI styles.
This commit is contained in:
parent
e6d383b020
commit
fcf9b57f8d
3 changed files with 16 additions and 2 deletions
14
ansi.scm
14
ansi.scm
|
@ -29,6 +29,12 @@
|
||||||
ansi
|
ansi
|
||||||
(
|
(
|
||||||
ansi
|
ansi
|
||||||
|
a:error
|
||||||
|
a:warning
|
||||||
|
a:success
|
||||||
|
a:neutral
|
||||||
|
a:default
|
||||||
|
a:muted
|
||||||
ansi-tests!
|
ansi-tests!
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,6 +72,14 @@
|
||||||
(string-intersperse argsl ";")
|
(string-intersperse argsl ";")
|
||||||
"m"))))
|
"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.
|
;; Performs ANSI module self-tests.
|
||||||
(define (ansi-tests!)
|
(define (ansi-tests!)
|
||||||
(run-tests
|
(run-tests
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
primes)
|
primes)
|
||||||
|
|
||||||
;; Print banner
|
;; Print banner
|
||||||
(print "brmsaptool 0.2 (c) 2023 Brmlab, z.s.")
|
(print "brmsaptool 0.3 (c) 2023 Brmlab, z.s.")
|
||||||
(newline)
|
(newline)
|
||||||
|
|
||||||
;; Run tests
|
;; Run tests
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
(newline)
|
(newline)
|
||||||
(print-source-listing lines highlights
|
(print-source-listing lines highlights
|
||||||
(*member-file-context*)
|
(*member-file-context*)
|
||||||
(ansi #:red #:bold) (ansi #:default)
|
a:error a:default
|
||||||
"" "" "..."))
|
"" "" "..."))
|
||||||
(if (eq? (*member-file-check-syntax*) 'error)
|
(if (eq? (*member-file-check-syntax*) 'error)
|
||||||
(exit 1)
|
(exit 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue