From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 04 18:00:45 2021 Received: (at submit) by debbugs.gnu.org; 4 Feb 2021 23:00:45 +0000 Received: from localhost ([127.0.0.1]:42433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7ncC-0007Mf-OC for submit@debbugs.gnu.org; Thu, 04 Feb 2021 18:00:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:55452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7ncA-0007MX-E1 for submit@debbugs.gnu.org; Thu, 04 Feb 2021 18:00:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7ncA-0006JI-0U for guix-patches@gnu.org; Thu, 04 Feb 2021 18:00:42 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:37995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7nc7-00025n-2v for guix-patches@gnu.org; Thu, 04 Feb 2021 18:00:41 -0500 Received: by mail-wm1-x32b.google.com with SMTP id y187so4412212wmd.3 for ; Thu, 04 Feb 2021 15:00:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=t7L1qnHOlPaDly9ceJ5Dr+vYe26yhEcYeWwkLN/vyp4=; b=ZeO5CL2ZvqKA6daep9JL1KrJAMvsCoSb74HUcY4Nf2Jx7aADbgU8zSCtjAxSUvRSZX oAcE2nrsUOklx7/MYyBRcVFUyo7LQf2uuR6IF5aVzXUnjWJyBX0/w/iom2QbwNryQDAO zZgzk3CqUcqdxPD6S4vJujFiVTRqWK8PjGLUi5J5W3eP7jGtX+oGarC8d225Fv0MhNT7 3IsyIY4nspTdu/lJxGVl1jYX0FSUJbsLvI4s7WVtAwPydmvqhRqBqmUoQe+h5OrICSX4 HX73JjHu4nPc81gOBUH6ZeASVaW6u3gFpuwdcXpFZHNyN6puqE2J38iMrRxF76iDR0zc ZDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=t7L1qnHOlPaDly9ceJ5Dr+vYe26yhEcYeWwkLN/vyp4=; b=rWpQWG88Zqj1RpG/i2aMm/ZYBxp1oDL/xAYNLVatHQqW6/hmak7cAaV5mBkOFjkzii Ys4fupPfdCWyVBVdLNyCdWyKN/cOee94BxCKw3qgrGRiT3wxCUIdnwBX19k0IDihA+OY H1zdAYc7L/FGmEKtEVqrg8I2UojifRFX3d8yzqvA5mb42tATeSzTzkBabZ1aDZiRn+yq MKx2IjCjeb5VpP1oQqhpGa6EFspIELugmcXzAc029dh3q1lUvwUemqRYqTDFQhANdnRf lEuX45RYqBPQ0xA1JC2wihJXvdWZr5ZgDW9TNDRJKZ5JmVQSYbKg/IfqCSaUYlGYZDjV q9ZA== X-Gm-Message-State: AOAM531aWOu07o0boi4yXi/O10/IzM93YbASEwRglUTEkrn3yQwWd8LE 62nYvHCY1Gh5WRpeAyVMPyppA+MqcXk= X-Google-Smtp-Source: ABdhPJzJC3X0usEz+qd7Uxf4PqKf2pY9ELqZFPj1azeIEbyJu+xvHjZkm9y0En6QtXhIJvgGlGOH9Q== X-Received: by 2002:a05:600c:4e91:: with SMTP id f17mr1114820wmq.142.1612479637430; Thu, 04 Feb 2021 15:00:37 -0800 (PST) Received: from lili.univ-paris-diderot.fr ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id n9sm10280907wrq.41.2021.02.04.15.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 15:00:37 -0800 (PST) From: zimoun To: guix-patches@gnu.org Subject: [PATCH 0/1] Fix 2 corner cases for option hint Date: Fri, 5 Feb 2021 00:00:28 +0100 Message-Id: <20210204230028.2275-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: zimoun 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, First, --8<---------------cut here---------------start------------->8--- $ guix package --shw=hello guix package: error: shw=hello: unrecognized option --8<---------------cut here---------------end--------------->8--- becomes --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix package --shw=hello guix package: error: shw=hello: unrecognized option hint: Did you mean `show'? --8<---------------cut here---------------end--------------->8--- And second the ugly (introduced by ’option’hint): --8<---------------cut here---------------start------------->8--- $ guix package -Z Backtrace: 11 (primitive-load "/home/simon/.config/guix/current/bin/guix") In guix/ui.scm: 2162:12 10 (run-guix-command _ . _) In guix/scripts/package.scm: 1075:2 9 (guix-package . _) In ice-9/boot-9.scm: 1731:15 8 (with-exception-handler # _ # _ …) In srfi/srfi-37.scm: 113:18 7 (next-arg) In unknown file: 6 (_ # # #) In guix/scripts.scm: 121:2 5 (_ _ #\Z _ . _) In guix/utils.scm: 920:4 4 (string-closest _ _ #:threshold _) In guix/combinators.scm: 46:26 3 (fold2 # #f # (…)) In guix/utils.scm: 921:25 2 (_ "help" #f +inf.0) 911:12 1 (string-distance #\Z "help") In unknown file: 0 (string->list #\Z # #) ERROR: In procedure string->list: In procedure string->list: Wrong type argument in position 1 (expecting string): #\Z --8<---------------cut here---------------end--------------->8--- is fixed: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix package -Z guix package: error: Z: unrecognized option --8<---------------cut here---------------end--------------->8--- A corner case is still missing: $ ./pre-inst-env guix environment -ah-hoc hello guix environment: error: a: unrecognized option where it could be nice to hint for. But from my understanding, it is not possible with SRFI-37. All the best, simon zimoun (1): guix: scripts: Fix corner cases of hint for option typo. guix/scripts.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) base-commit: 5ae09d7979a0696d862b9555314eab199f7ce576 -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 04 18:03:00 2021 Received: (at 46308) by debbugs.gnu.org; 4 Feb 2021 23:03:00 +0000 Received: from localhost ([127.0.0.1]:42456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7neN-0007RA-Vf for submit@debbugs.gnu.org; Thu, 04 Feb 2021 18:03:00 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:37350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7neM-0007QH-CX for 46308@debbugs.gnu.org; Thu, 04 Feb 2021 18:02:59 -0500 Received: by mail-wr1-f48.google.com with SMTP id v15so5520068wrx.4 for <46308@debbugs.gnu.org>; Thu, 04 Feb 2021 15:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FZr0outj+Lnzvw9XZ9rzKv4v4fM7mGuJ83CEhwsMelg=; b=Tn8N6ySyOq3x9nJFHgcrzf+ZytKnqd1CTEWpa1ApyI/djpU1W61jSMdpzjES8o27Si NPdAAlj6xQgxJzSzhGhGtcy140p+UhmK9331TDzcUuNdgqKMsA6Z0BNJmFg4mZnifmos I3ZXZhA5OJjLDIG894ytoV2B3QK2oE6mtJssoo/4Ix5AcWCIqePWIsWe/sSWRXWhHJC3 aareMW/ZT6RIxPHv47IzGobnizP7Kyh5D9RA0vcD1Vhb9/gquRnzfp82DgcZgnuSaQk5 8Ow+YBJrO01QFv0Zq18HaUGvV1ix8J9IcXtjKSNDvH3O/rij9+m0OIzczqI8ohvZdpY+ b2sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FZr0outj+Lnzvw9XZ9rzKv4v4fM7mGuJ83CEhwsMelg=; b=KWRR3Zx+sninn7aOq5NrQ8x/pCi2ZiRSjgAnbi8hff0vIYkZMooL+zcy5y58g73aiP yaED9OkY/ZJQApj8D39gVkJx/n9fh6N7nvsGVgqy9+YrXLunv2BIXeDBCENxzx5geEVD kmGWD+Kc/s15PQtoReT+ME36EOIhRsUJkVo7+Bgb/bfuy+nLWJkZWe2E1SXgcX+81mu1 kU1JyxOFYZaLWFeXPupPEI6ww1HyvR3g+XmWGYcBfSR99gXj2jRsMpkpAKdTIuHnhDtc qEPn6UuhRTMnEV27jXtHjk0YZ6yGSwwZBAZv2MoijyPYnbrvGwtl5SAaYeUf55j86oNI JBZw== X-Gm-Message-State: AOAM530le+z8pqyup4ZXThH+/aaIMI2tvcPPI0HYnP4GkgxSpMucsIYY 5Ezb5K+hYFslZfcXlbJUnCr5wHlyusM= X-Google-Smtp-Source: ABdhPJws12c3TKPIDwPI0xcSzirB2nh3+34Tc3KPDMN7pIdw7LXhe4bz3AVASP532r1gecLF17Sn+g== X-Received: by 2002:a05:6000:188c:: with SMTP id a12mr1723412wri.105.1612479772418; Thu, 04 Feb 2021 15:02:52 -0800 (PST) Received: from lili.univ-paris-diderot.fr ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id 23sm7214352wmo.47.2021.02.04.15.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 15:02:52 -0800 (PST) From: zimoun To: 46308@debbugs.gnu.org Subject: [PATCH 1/1] guix: scripts: Fix corner cases of hint for option typo. Date: Fri, 5 Feb 2021 00:02:50 +0100 Message-Id: <20210204230250.3304-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46308 Cc: zimoun 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.0 (-) * guix/scripts.scm (option-hint): Fix corner cases. --- guix/scripts.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/scripts.scm b/guix/scripts.scm index c9ea9f2e29..1773894bc2 100644 --- a/guix/scripts.scm +++ b/guix/scripts.scm @@ -118,7 +118,12 @@ procedure, but both the category and synopsis are meant to be read (parsed) by according to'string-distance'." (define (options->long-names options) (filter string? (append-map option-names options))) - (string-closest guess (options->long-names options) #:threshold 3)) + (match guess + ((? string?) + (match (string-split guess #\=) + ((name rest ...) + (string-closest name (options->long-names options) #:threshold 3)))) + (_ #f))) (define (args-fold* args options unrecognized-option-proc operand-proc . seeds) "A wrapper on top of `args-fold' that does proper user-facing error -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 24 17:52:01 2021 Received: (at 46308-done) by debbugs.gnu.org; 24 Feb 2021 22:52:01 +0000 Received: from localhost ([127.0.0.1]:36145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lF30j-0001Bj-1e for submit@debbugs.gnu.org; Wed, 24 Feb 2021 17:52:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lF30i-0001BX-3y for 46308-done@debbugs.gnu.org; Wed, 24 Feb 2021 17:52:00 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43414) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lF30c-0008Ab-PB; Wed, 24 Feb 2021 17:51:54 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48968 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lF30c-0008Ui-BI; Wed, 24 Feb 2021 17:51:54 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: bug#46308: [PATCH 0/1] Fix 2 corner cases for option hint References: <20210204230028.2275-1-zimon.toutoune@gmail.com> <20210204230250.3304-1-zimon.toutoune@gmail.com> Date: Wed, 24 Feb 2021 23:51:53 +0100 In-Reply-To: <20210204230250.3304-1-zimon.toutoune@gmail.com> (zimoun's message of "Fri, 5 Feb 2021 00:02:50 +0100") Message-ID: <877dmx2i5y.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46308-done Cc: 46308-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: -1.7 (-) Hi, zimoun skribis: > * guix/scripts.scm (option-hint): Fix corner cases. Applied! I also reverted the change I made in 11f11d7ecb817d1421f8b5340bcced59396d8708, which addressed the short-option problem you mention. Thanks, Ludo=E2=80=99. From unknown Sat Aug 16 16:07:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 25 Mar 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator