aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2022-05-08 18:52:33 +0200
committerMathieu Othacehe <othacehe@gnu.org>2022-05-22 15:15:33 +0200
commit051c087d7187d705e98015e8654dd20f66ce23d4 (patch)
tree0ab86ef2aa1fd84f0ecd43cc50c8f551eddc76a3
parentb55310603f0df7d5ae02d47cb8d4be58bf1d41ca (diff)
downloadguix-051c087d7187d705e98015e8654dd20f66ce23d4.tar
guix-051c087d7187d705e98015e8654dd20f66ce23d4.tar.gz
scripts: build: Highlight the current system with --list-systems.
* guix/scripts/build.scm (list-systems): Highlight it.
-rw-r--r--guix/scripts/build.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index a09c54451f..4383a399a0 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -21,6 +21,7 @@
(define-module (guix scripts build)
#:use-module (guix ui)
+ #:use-module (guix colors)
#:use-module (guix scripts)
#:autoload (guix import json) (json->scheme-file)
#:use-module (guix store)
@@ -342,8 +343,15 @@ use '--no-offload' instead~%")))
"Print the available systems."
(display (G_ "The available systems are:\n"))
(newline)
- (format #t "~{ - ~a ~%~}"
- (sort (systems) string<?)))
+ (let ((systems*
+ (map (lambda (system)
+ (if (string=? system (%current-system))
+ (highlight
+ (string-append system " [current]"))
+ system))
+ (systems))))
+ (format #t "~{ - ~a ~%~}"
+ (sort systems* string<?))))
(define (list-targets)
"Print the available targets."