From unknown Sat Jun 14 05:00:19 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41265] [PATCH] guix describe: Add '--list-formats' Resent-From: Ekaitz Zarraga Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 May 2020 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41265 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41265@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Reply-To: Ekaitz Zarraga Received: via spool by submit@debbugs.gnu.org id=B.158947026123808 (code B ref -1); Thu, 14 May 2020 15:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 May 2020 15:31:01 +0000 Received: from localhost ([127.0.0.1]:34510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZFp7-0006BW-7u for submit@debbugs.gnu.org; Thu, 14 May 2020 11:31:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:54438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZFp5-00069w-Po for submit@debbugs.gnu.org; Thu, 14 May 2020 11:31:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZFp5-0000oV-J4 for guix-patches@gnu.org; Thu, 14 May 2020 11:30:59 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:14264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZFp3-0002cC-U7 for guix-patches@gnu.org; Thu, 14 May 2020 11:30:59 -0400 Date: Thu, 14 May 2020 15:30:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589470251; bh=4fvTW5+4bx8uAptIHcsxG4f5Hv+cw2xWhBZ8wnA0i7U=; h=Date:To:From:Reply-To:Subject:From; b=pBVdRAQD/4eInhBsVYMlVdmEsbaWNqt6Z0YEYyDy6rMF+RLJBZ9iT287zImdVgFxa 7qT7i7wtya2AjKk6T2dd2/HVwgHPSbcDo3fkdVYOGkw0O5M4qaElvI/r4rujL5+Fw2 1bAxmALqya7OPxizIIe0vB/ZyuMjFoIOWd8+4kRA= From: Ekaitz Zarraga Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch Received-SPF: pass client-ip=185.70.40.131; envelope-from=ekaitz@elenq.tech; helo=mail-40131.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 11:30:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, Added `--list-formats` option to `guix describe` in order to improve user e= xperience 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 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 =C2=A9 2018, 2019, 2020 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Oleg Pykhalov +;;; Copyright =C2=A9 2020 Ekaitz Zarraga ;;; ;;; 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" "recutil= s")) + (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=3DFORMAT display information in the given FORMAT")) + (display (G_ " + --list-formats display available formats")) (display (G_ " -p, --profile=3DPROFILE display information about PROFILE")) (newline) -- 2.26.1 From unknown Sat Jun 14 05:00:19 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41265] [PATCH] guix describe: Add '--list-formats' Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 May 2020 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41265 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ekaitz Zarraga Cc: 41265@debbugs.gnu.org Received: via spool by 41265-submit@debbugs.gnu.org id=B41265.158965054228764 (code B ref 41265); Sat, 16 May 2020 17:36:02 +0000 Received: (at 41265) by debbugs.gnu.org; 16 May 2020 17:35:42 +0000 Received: from localhost ([127.0.0.1]:41693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ja0is-0007Ts-4n for submit@debbugs.gnu.org; Sat, 16 May 2020 13:35:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ja0ip-0007Tg-Vw for 41265@debbugs.gnu.org; Sat, 16 May 2020 13:35:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45202) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ja0ik-0004VG-Nn; Sat, 16 May 2020 13:35:34 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40390 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ja0ik-0004VY-8a; Sat, 16 May 2020 13:35:34 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Sat, 16 May 2020 19:35:32 +0200 In-Reply-To: (Ekaitz Zarraga's message of "Thu, 14 May 2020 15:30:40 +0000") Message-ID: <87r1vjpyu3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ekaitz Zarraga skribis: >>>From 75f16431475fb692228f69be06baa635eb6fa5b7 Mon Sep 17 00:00:00 2001 > From: Ekaitz Zarraga > 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=E2=80=99. From unknown Sat Jun 14 05:00:19 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#41265] [PATCH] guix describe: Add '--list-formats' Resent-From: Ekaitz Zarraga Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 May 2020 18:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41265 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: "41265@debbugs.gnu.org" <41265@debbugs.gnu.org> Reply-To: Ekaitz Zarraga Received: via spool by 41265-submit@debbugs.gnu.org id=B41265.15896520937053 (code B ref 41265); Sat, 16 May 2020 18:02:02 +0000 Received: (at 41265) by debbugs.gnu.org; 16 May 2020 18:01:33 +0000 Received: from localhost ([127.0.0.1]:41729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ja17t-0001ph-Bf for submit@debbugs.gnu.org; Sat, 16 May 2020 14:01:33 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:51096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ja17r-0001pT-HQ for 41265@debbugs.gnu.org; Sat, 16 May 2020 14:01:32 -0400 Date: Sat, 16 May 2020 18:01:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589652084; bh=V6GKg74nP0ImSZubMUC/Pt3n8SFKALoTetvCpkbSGsE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=tgQxzlgoa45IHNXKC1yNogWVQk4Y54TjJQEta8ZuVXZO+jkHslvbhFv2nzpld1pm2 TeLFYHHogkNCfUNLwx57E+AjTKB0C9tn2pxZmHCvwa3dNqENG/7+UoY/swR3IP0e+M xASs3nIqPUu62IlBfWkP8KvuRnrEszL00ttpyt90= From: Ekaitz Zarraga Message-ID: In-Reply-To: <87r1vjpyu3.fsf@gnu.org> References: <87r1vjpyu3.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Saturday, May 16, 2020 7:35 PM, Ludovic Court=C3=A8s wrot= e: > Ekaitz Zarraga ekaitz@elenq.tech skribis: > > > > From 75f16431475fb692228f69be06baa635eb6fa5b7 Mon Sep 17 00:00:00 200= 1 > > > From: Ekaitz Zarraga ekaitz@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=E2=80=99. There it goes, not sure if I added it right to the docs, never edited a tex= i before :) Cheers! >From f7af79434eb702140ddadb321a4fcaaf197dbf45 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga 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 form= at; produce a list of channel specifications in Recutils format. @end table +@item --list-formats +Display available formats for @option{--format} option. + @item --profile=3D@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 =C2=A9 2018, 2019, 2020 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Oleg Pykhalov +;;; Copyright =C2=A9 2020 Ekaitz Zarraga ;;; ;;; 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" "recutil= s")) + (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=3DFORMAT display information in the given FORMAT")) + (display (G_ " + --list-formats display available formats")) (display (G_ " -p, --profile=3DPROFILE display information about PROFILE")) (newline) -- 2.26.1 From unknown Sat Jun 14 05:00:19 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ekaitz Zarraga Subject: bug#41265: closed (Re: [bug#41265] [PATCH] guix describe: Add '--list-formats') Message-ID: References: <87k119iftq.fsf@gnu.org> X-Gnu-PR-Message: they-closed 41265 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 41265@debbugs.gnu.org Date: Mon, 18 May 2020 12:33:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1589805182-2492-1" This is a multi-part message in MIME format... ------------=_1589805182-2492-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #41265: [PATCH] guix describe: Add '--list-formats' which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 41265@debbugs.gnu.org. --=20 41265: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D41265 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1589805182-2492-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 41265-done) by debbugs.gnu.org; 18 May 2020 12:32:42 +0000 Received: from localhost ([127.0.0.1]:46196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaewk-0000dX-DT for submit@debbugs.gnu.org; Mon, 18 May 2020 08:32:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaewi-0000dK-Uo for 41265-done@debbugs.gnu.org; Mon, 18 May 2020 08:32:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56548) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaewd-00010r-C9; Mon, 18 May 2020 08:32:35 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37672 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jaewc-0000lf-Lw; Mon, 18 May 2020 08:32:34 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ekaitz Zarraga Subject: Re: [bug#41265] [PATCH] guix describe: Add '--list-formats' References: <87r1vjpyu3.fsf@gnu.org> Date: Mon, 18 May 2020 14:32:33 +0200 In-Reply-To: (Ekaitz Zarraga's message of "Sat, 16 May 2020 18:01:23 +0000") Message-ID: <87k119iftq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41265-done Cc: "41265@debbugs.gnu.org" <41265-done@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Ekaitz Zarraga skribis: >>>From f7af79434eb702140ddadb321a4fcaaf197dbf45 Mon Sep 17 00:00:00 2001 > From: Ekaitz Zarraga > 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=E2=80=99. ------------=_1589805182-2492-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 May 2020 15:31:01 +0000 Received: from localhost ([127.0.0.1]:34510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZFp7-0006BW-7u for submit@debbugs.gnu.org; Thu, 14 May 2020 11:31:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:54438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZFp5-00069w-Po for submit@debbugs.gnu.org; Thu, 14 May 2020 11:31:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZFp5-0000oV-J4 for guix-patches@gnu.org; Thu, 14 May 2020 11:30:59 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:14264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZFp3-0002cC-U7 for guix-patches@gnu.org; Thu, 14 May 2020 11:30:59 -0400 Date: Thu, 14 May 2020 15:30:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589470251; bh=4fvTW5+4bx8uAptIHcsxG4f5Hv+cw2xWhBZ8wnA0i7U=; h=Date:To:From:Reply-To:Subject:From; b=pBVdRAQD/4eInhBsVYMlVdmEsbaWNqt6Z0YEYyDy6rMF+RLJBZ9iT287zImdVgFxa 7qT7i7wtya2AjKk6T2dd2/HVwgHPSbcDo3fkdVYOGkw0O5M4qaElvI/r4rujL5+Fw2 1bAxmALqya7OPxizIIe0vB/ZyuMjFoIOWd8+4kRA= To: "guix-patches@gnu.org" From: Ekaitz Zarraga Subject: [PATCH] guix describe: Add '--list-formats' Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch Received-SPF: pass client-ip=185.70.40.131; envelope-from=ekaitz@elenq.tech; helo=mail-40131.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 11:30:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Ekaitz Zarraga Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, Added `--list-formats` option to `guix describe` in order to improve user e= xperience 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 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 =C2=A9 2018, 2019, 2020 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Oleg Pykhalov +;;; Copyright =C2=A9 2020 Ekaitz Zarraga ;;; ;;; 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" "recutil= s")) + (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=3DFORMAT display information in the given FORMAT")) + (display (G_ " + --list-formats display available formats")) (display (G_ " -p, --profile=3DPROFILE display information about PROFILE")) (newline) -- 2.26.1 ------------=_1589805182-2492-1--