scripts: build: Highlight the current system with --list-systems.
* guix/scripts/build.scm (list-systems): Highlight it.
This commit is contained in:
		
							parent
							
								
									b55310603f
								
							
						
					
					
						commit
						051c087d71
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -21,6 +21,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-module (guix scripts build)
 | 
					(define-module (guix scripts build)
 | 
				
			||||||
  #:use-module (guix ui)
 | 
					  #:use-module (guix ui)
 | 
				
			||||||
 | 
					  #:use-module (guix colors)
 | 
				
			||||||
  #:use-module (guix scripts)
 | 
					  #:use-module (guix scripts)
 | 
				
			||||||
  #:autoload   (guix import json) (json->scheme-file)
 | 
					  #:autoload   (guix import json) (json->scheme-file)
 | 
				
			||||||
  #:use-module (guix store)
 | 
					  #:use-module (guix store)
 | 
				
			||||||
| 
						 | 
					@ -342,8 +343,15 @@ use '--no-offload' instead~%")))
 | 
				
			||||||
  "Print the available systems."
 | 
					  "Print the available systems."
 | 
				
			||||||
  (display (G_ "The available systems are:\n"))
 | 
					  (display (G_ "The available systems are:\n"))
 | 
				
			||||||
  (newline)
 | 
					  (newline)
 | 
				
			||||||
 | 
					  (let ((systems*
 | 
				
			||||||
 | 
					         (map (lambda (system)
 | 
				
			||||||
 | 
					                (if (string=? system (%current-system))
 | 
				
			||||||
 | 
					                    (highlight
 | 
				
			||||||
 | 
					                     (string-append system " [current]"))
 | 
				
			||||||
 | 
					                    system))
 | 
				
			||||||
 | 
					              (systems))))
 | 
				
			||||||
    (format #t "~{   - ~a ~%~}"
 | 
					    (format #t "~{   - ~a ~%~}"
 | 
				
			||||||
          (sort (systems) string<?)))
 | 
					            (sort systems* string<?))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define (list-targets)
 | 
					(define (list-targets)
 | 
				
			||||||
  "Print the available targets."
 | 
					  "Print the available targets."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue