From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iBgBGAdnvV44bgAA0tVLHw (envelope-from ) for ; Thu, 14 May 2020 15:43:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eFpSEgdnvV7PYwAAB5/wlQ (envelope-from ) for ; Thu, 14 May 2020 15:43:03 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B3ABC940058 for ; Thu, 14 May 2020 15:43:02 +0000 (UTC) Received: from localhost ([::1]:57462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZG0h-0007CI-Vq for larch@yhetil.org; Thu, 14 May 2020 11:43:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZG0d-00079B-CP for guix-patches@gnu.org; Thu, 14 May 2020 11:42:55 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZG0d-0005Wj-3f for guix-patches@gnu.org; Thu, 14 May 2020 11:42:55 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZFp9-0006D2-0w for guix-patches@gnu.org; Thu, 14 May 2020 11:31:03 -0400 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" 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 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 X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Ekaitz Zarraga Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=elenq.tech header.s=protonmail header.b=pBVdRAQD; dmarc=fail reason="SPF not aligned (relaxed)" header.from=elenq.tech (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 1.59 X-TUID: 8icc+5LWdfwL 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