[Top][All Lists]

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

guix describe user experience improvement proposition

From: Ekaitz Zarraga
Subject: guix describe user experience improvement proposition
Date: Tue, 12 May 2020 19:07:14 +0000

Hi all,

Yesterday I wanted to use `guix describe` and I felt quite helpless when 
choosing the format I wanted.

I suggest adding the possible format list in the help of the `guix describe -h` 
command. That way the feature discovery is easier for users that don't want to 
dig in the code.

It should be easy to add, something like the diff I add below (untested and 
horrible, the idea is to help me explain myself rather than serving as a 

How do you feel about this?
Interesting for anyone? Is there any reason why it's not added already that I 
might be missing?


The obnoxious diff:

diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index f13f221da9..0222ed0951 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -42,11 +42,13 @@
 ;;; Command-line options.

+(define available-formats '("human" "channels" "json" "recutils"))
 (define %options
   ;; Specifications of the command-line options.
   (list (option '(#\f "format") #t #f
                 (lambda (opt name arg result)
-                  (unless (member arg '("human" "channels" "json" "recutils"))
+                  (unless (member arg available-formats)
                     (leave (G_ "~a: unsupported output format~%") arg))
                   (alist-cons 'format (string->symbol arg) result)))
         (option '(#\p "profile") #t #f
@@ -68,8 +70,8 @@
 (define (show-help)
   (display (G_ "Usage: guix describe [OPTION]...
 Display information about the channels currently in use.\n"))
-  (display (G_ "
-  -f, --format=FORMAT    display information in the given FORMAT"))
+  (display (string-append (G_ "
+  -f, --format=FORMAT    display information in the given FORMAT: ") 
(string-join available-formats "|")))
   (display (G_ "
   -p, --profile=PROFILE  display information about PROFILE"))

reply via email to

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