unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* guix describe user experience improvement proposition
@ 2020-05-12 19:07 Ekaitz Zarraga
  2020-05-12 19:44 ` zimoun
  0 siblings, 1 reply; 4+ messages in thread
From: Ekaitz Zarraga @ 2020-05-12 19:07 UTC (permalink / raw)
  To: guix-devel\@gnu.org

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 contribution).

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

Cheers,
Ekaitz

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"))
   (newline)




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-12 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 19:07 guix describe user experience improvement proposition Ekaitz Zarraga
2020-05-12 19:44 ` zimoun
2020-05-12 20:13   ` Ekaitz Zarraga
2020-05-12 22:20     ` Ekaitz Zarraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).