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 eJuvGSkhu15OWwAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 22:20:25 +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 yP2jNjchu17BagAAB5/wlQ (envelope-from ) for ; Tue, 12 May 2020 22:20:39 +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 B3CE4940DEC for ; Tue, 12 May 2020 22:20:37 +0000 (UTC) Received: from localhost ([::1]:35122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYdGQ-0003Pv-IA for larch@yhetil.org; Tue, 12 May 2020 18:20:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYdGE-0003Ny-SN for guix-devel@gnu.org; Tue, 12 May 2020 18:20:26 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:54588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYdGD-0005Z4-7s for guix-devel@gnu.org; Tue, 12 May 2020 18:20:26 -0400 Date: Tue, 12 May 2020 22:20:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail; t=1589322022; bh=u6yqn2VPS2onkn59jMF/rIqDYWAL7wjo1XZcYn/Jr8s=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=ng0lDcu/GTmXG0RyBpxK56wCqBHDWeS8kkTQOCSSESyQZ2J9cE3hnVi8hYCrou0cz 9VFEn0YAGktD/Bm+Dal8p4rVSLEjonXz4o/ZyEglV3siokaxCgWLAcmLKnKZ5rOVB2 LHRzLAPPmm6ByRKsyxjvx+SmTQC2yt/WsphFvP8I= To: Ekaitz Zarraga From: Ekaitz Zarraga Subject: Re: guix describe user experience improvement proposition Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.134; envelope-from=ekaitz@elenq.tech; helo=mail-40134.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 18:20:22 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_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Ekaitz Zarraga Cc: "guix-devel\\\\\\\\@gnu.org" Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=elenq.tech header.s=protonmail header.b=ng0lDcu/; dmarc=fail reason="SPF not aligned (relaxed)" header.from=elenq.tech (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; HAS_REPLYTO(0.00)[ekaitz@elenq.tech]; GENERIC_REPUTATION(0.00)[-0.53961779307729]; DWL_DNSWL_BLOCKED(0.00)[209.51.188.17:from]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; R_DKIM_REJECT(1.00)[elenq.tech:s=protonmail]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.06), country: US(-0.00), ip: 209.51.188.17(-0.54)]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[elenq.tech:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[elenq.tech:email]; FROM_NEQ_ENVFROM(0.00)[ekaitz@elenq.tech,guix-devel-bounces@gnu.org]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[elenq.tech : SPF not aligned (relaxed),none] X-TUID: eUW1w60QxeeH On Tuesday, May 12, 2020 10:13 PM, Ekaitz Zarraga wrote= : > On Tuesday, May 12, 2020 9:44 PM, zimoun zimon.toutoune@gmail.com wrote: > > Usually, the way to add such information is '--list-formats', e.g., > > see "guix graph"with '--list-types' and '-list-backends'. I do not > > know if it is an usually. ;-) > > But do you think it's interesting? > Or is it just me? > > I like the `--list-types` approach. If it's interesting I would contribut= e with a patch. Hi, It would be something like this, tested and working. Opinions? Best, Ekaitz diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index f13f221da9..69c6d8482f 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -42,13 +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)