guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/08: scripts: build: Highlight the current system with --list-systems.


From: guix-commits
Subject: 07/08: scripts: build: Highlight the current system with --list-systems.
Date: Sun, 22 May 2022 09:15:58 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit 051c087d7187d705e98015e8654dd20f66ce23d4
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun May 8 18:52:33 2022 +0200

    scripts: build: Highlight the current system with --list-systems.
    
    * guix/scripts/build.scm (list-systems): Highlight it.
---
 guix/scripts/build.scm | 12 ++++++++++--
 1 file 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]