From patchwork Thu Mar 16 16:11:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 48053 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AE32916CC1; Thu, 16 Mar 2023 16:12:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A935516A9E for ; Thu, 16 Mar 2023 16:12:10 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcqCy-0003xp-Bh; Thu, 16 Mar 2023 12:12:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqCw-0003xU-RO for guix-patches@gnu.org; Thu, 16 Mar 2023 12:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcqCw-0004jx-DI; Thu, 16 Mar 2023 12:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pcqCv-0004nZ-Pg; Thu, 16 Mar 2023 12:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62222] [PATCH] ui: format 'display-hint' output when no arguments are passed. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Thu, 16 Mar 2023 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62222 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62222@debbugs.gnu.org Cc: ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167898311818433 (code B ref -1); Thu, 16 Mar 2023 16:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Mar 2023 16:11:58 +0000 Received: from localhost ([127.0.0.1]:42787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcqCs-0004nF-3Y for submit@debbugs.gnu.org; Thu, 16 Mar 2023 12:11:58 -0400 Received: from lists.gnu.org ([209.51.188.17]:53334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcqCn-0004n1-8B for submit@debbugs.gnu.org; Thu, 16 Mar 2023 12:11:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqCn-0003vu-2J for guix-patches@gnu.org; Thu, 16 Mar 2023 12:11:53 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pcqCk-0004fw-Q8 for guix-patches@gnu.org; Thu, 16 Mar 2023 12:11:52 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4PcshQ08gBz9sWs for ; Thu, 16 Mar 2023 17:11:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1678983094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QrG4wVVFrFINzuH3Xa9oPZjQ8k+9NS4olBxZ42o9SI0=; b=KJzf6n3/RkB6IhOzMQV6Q1KlgMFcEhiPk5LKWztEl7fJlcyrzp2kjKrpfZQNm+VToJRJHp c41xQYFD2WKII0wSz5QRsHgPpnChiA+7w1TJATrAIFa8L7MztI9oILt2UmE3dxU/+Q2HRI 7voWvaSWgHQ33Bl7vU60uWlUM/yVihhDo90XWBjIMxW48BzIof56T0Q/uTK/VFNUFG1OH2 Fr3NOkasqGb5bThXJrt5ZoNe6aWdg2vjHkkY2+E4aTupMlNf8kMVov04jXLT3MweXwJ5on 51Li3nb9N5b6jRYqH7lw1cdzyj9f6QYxgiYh59+Ql5en5oQMLiaGG6cyU2mmKA== Date: Thu, 16 Mar 2023 16:11:20 +0000 Message-Id: <20230316161120.9294-1-antero@mailbox.org> MIME-Version: 1.0 X-MBO-RS-ID: 60a82df04c0bf2fdfbe X-MBO-RS-META: iw93staomtw7gcscs8p6yrtyg6qqaap9 Received-SPF: pass client-ip=80.241.56.171; envelope-from=antero@mailbox.org; helo=mout-p-201.mailbox.org 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches X-Patchwork-Original-From: Antero Mejr via Guix-patches via From: Antero Mejr Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches When display-hint is given format specifiers such as "~%" but no arguments, it does not format the output, causing the specifiers to be visible in the displayed text. * guix/ui.scm (display-hint): Format output when no arguments are passed. --- Steps to reproduce the issue this fixes: $ guix build -s whatever hello guix build: error: 'whatever' is not a supported system hint: Try `--list-systems' to view available system types.~% guix/ui.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/ui.scm b/guix/ui.scm index b6c3bd04ba..7540e2194f 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -323,7 +323,7 @@ (define colorize ;; XXX: We should arrange so that the initial indent is wider. (parameterize ((%text-width (max 15 (- (terminal-columns) 5)))) (texi->plain-text (match arguments - (() message) + (() (format #f message)) (_ (apply format #f message (map (match-lambda ((? string? str)