GNU bug report logs -
#41265
[PATCH] guix describe: Add '--list-formats'
Previous Next
Reported by: Ekaitz Zarraga <ekaitz <at> elenq.tech>
Date: Thu, 14 May 2020 15:31:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41265 in the body.
You can then email your comments to 41265 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#41265
; Package
guix-patches
.
(Thu, 14 May 2020 15:31:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ekaitz Zarraga <ekaitz <at> elenq.tech>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Thu, 14 May 2020 15:31:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
Added `--list-formats` option to `guix describe` in order to improve user experience as discussed here:
https://lists.nongnu.org/archive/html/guix-devel/2020-05/msg00215.html
Hope it's useful.
Ekaitz
---
From 75f16431475fb692228f69be06baa635eb6fa5b7 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
Date: Thu, 14 May 2020 17:25:03 +0200
Subject: [PATCH] guix describe: Add '--list-formats'
* guix/scripts/describe.scm (%available-formats): New variable.
(list-fortmats): New procedure.
(%options, show-help): Add --list-formats
---
guix/scripts/describe.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index f13f221da9..029098cea2 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust <at> gmail.com>
+;;; Copyright © 2020 Ekaitz Zarraga <ekaitz <at> elenq.tech>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,13 +43,26 @@
;;; Command-line options.
;;;
+(define %available-formats '("human" "channels" "json" "recutils"))
+
+(define (list-formats)
+ (display (G_ "The available formats are:\n"))
+ (newline)
+ (for-each (lambda (f)
+ (format #t " - ~a~%" f))
+ %available-formats))
+
(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 '("list-formats") #f #f
+ (lambda (opt name arg result)
+ (list-formats)
+ (exit 0)))
(option '(#\p "profile") #t #f
(lambda (opt name arg result)
(alist-cons 'profile (canonicalize-profile arg)
@@ -70,6 +84,8 @@
Display information about the channels currently in use.\n"))
(display (G_ "
-f, --format=FORMAT display information in the given FORMAT"))
+ (display (G_ "
+ --list-formats display available formats"))
(display (G_ "
-p, --profile=PROFILE display information about PROFILE"))
(newline)
--
2.26.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41265
; Package
guix-patches
.
(Sat, 16 May 2020 17:36:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 41265 <at> debbugs.gnu.org (full text, mbox):
Ekaitz Zarraga <ekaitz <at> elenq.tech> skribis:
>>From 75f16431475fb692228f69be06baa635eb6fa5b7 Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
> Date: Thu, 14 May 2020 17:25:03 +0200
> Subject: [PATCH] guix describe: Add '--list-formats'
>
> * guix/scripts/describe.scm (%available-formats): New variable.
> (list-fortmats): New procedure.
^^
Typo.
> (%options, show-help): Add --list-formats
Could you also add the option to doc/guix.texi?
TIA!
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#41265
; Package
guix-patches
.
(Sat, 16 May 2020 18:02:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 41265 <at> debbugs.gnu.org (full text, mbox):
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, May 16, 2020 7:35 PM, Ludovic Courtès <ludo <at> gnu.org> wrote:
> Ekaitz Zarraga ekaitz <at> elenq.tech skribis:
>
> > > From 75f16431475fb692228f69be06baa635eb6fa5b7 Mon Sep 17 00:00:00 2001
> > > From: Ekaitz Zarraga ekaitz <at> elenq.tech
> > > Date: Thu, 14 May 2020 17:25:03 +0200
> > > Subject: [PATCH] guix describe: Add '--list-formats'
> >
> > * guix/scripts/describe.scm (%available-formats): New variable.
> > (list-fortmats): New procedure.
> >
>
> ^^
>
>
> Typo.
>
> > (%options, show-help): Add --list-formats
> >
>
> Could you also add the option to doc/guix.texi?
>
> TIA!
>
> Ludo’.
There it goes, not sure if I added it right to the docs, never edited a texi before :)
Cheers!
From f7af79434eb702140ddadb321a4fcaaf197dbf45 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
Date: Sat, 16 May 2020 19:57:18 +0200
Subject: [PATCH] guix describe: Add '--list-formats'
* guix/scripts/describe.scm (%available-formats): New variable.
(list-formats): New procedure.
(%options, show-help): Add --list-formats
* doc/guix.texi: Add --list-formats
---
doc/guix.texi | 3 +++
guix/scripts/describe.scm | 17 ++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index d043852ac3..de2cbdf6e5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4475,6 +4475,9 @@ produce a list of channel specifications in JSON format;
produce a list of channel specifications in Recutils format.
@end table
+@item --list-formats
+Display available formats for @option{--format} option.
+
@item --profile=@var{profile}
@itemx -p @var{profile}
Display information about @var{profile}.
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index f13f221da9..7a2dbc453a 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust <at> gmail.com>
+;;; Copyright © 2020 Ekaitz Zarraga <ekaitz <at> elenq.tech>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -41,14 +42,26 @@
;;;
;;; Command-line options.
;;;
+(define %available-formats '("human" "channels" "json" "recutils"))
+
+(define (list-formats)
+ (display (G_ "The available formats are:\n"))
+ (newline)
+ (for-each (lambda (f)
+ (format #t " - ~a~%" f))
+ %available-formats))
(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 '("list-formats") #f #f
+ (lambda (opt name arg result)
+ (list-formats)
+ (exit 0)))
(option '(#\p "profile") #t #f
(lambda (opt name arg result)
(alist-cons 'profile (canonicalize-profile arg)
@@ -70,6 +83,8 @@
Display information about the channels currently in use.\n"))
(display (G_ "
-f, --format=FORMAT display information in the given FORMAT"))
+ (display (G_ "
+ --list-formats display available formats"))
(display (G_ "
-p, --profile=PROFILE display information about PROFILE"))
(newline)
--
2.26.1
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Mon, 18 May 2020 12:33:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ekaitz Zarraga <ekaitz <at> elenq.tech>
:
bug acknowledged by developer.
(Mon, 18 May 2020 12:33:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 41265-done <at> debbugs.gnu.org (full text, mbox):
Hi,
Ekaitz Zarraga <ekaitz <at> elenq.tech> skribis:
>>From f7af79434eb702140ddadb321a4fcaaf197dbf45 Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
> Date: Sat, 16 May 2020 19:57:18 +0200
> Subject: [PATCH] guix describe: Add '--list-formats'
>
> * guix/scripts/describe.scm (%available-formats): New variable.
> (list-formats): New procedure.
> (%options, show-help): Add --list-formats
> * doc/guix.texi: Add --list-formats
I removed the leading space above and applied it. Thank you!
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 16 Jun 2020 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 363 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.