From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QB7kHPBOL2FwNQAAgWs5BA (envelope-from ) for ; Wed, 01 Sep 2021 11:59:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AHJXGPBOL2FoaAAAbx9fmQ (envelope-from ) for ; Wed, 01 Sep 2021 09:59:12 +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 2606E7FC2 for ; Wed, 1 Sep 2021 11:59:12 +0200 (CEST) Received: from localhost ([::1]:50078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLN1T-0007PS-AB for larch@yhetil.org; Wed, 01 Sep 2021 05:59:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLN1K-0007Ni-Vl for guix-patches@gnu.org; Wed, 01 Sep 2021 05:59:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLN1K-0006lv-Nu for guix-patches@gnu.org; Wed, 01 Sep 2021 05:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mLN1K-0007DP-N2 for guix-patches@gnu.org; Wed, 01 Sep 2021 05:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50314] [PATCH 1/2] import: Add hint for importer typo. References: <20210901095538.12813-1-zimon.toutoune@gmail.com> In-Reply-To: <20210901095538.12813-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Sep 2021 09:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50314 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50314@debbugs.gnu.org Cc: zimoun Received: via spool by 50314-submit@debbugs.gnu.org id=B50314.163049029027649 (code B ref 50314); Wed, 01 Sep 2021 09:59:02 +0000 Received: (at 50314) by debbugs.gnu.org; 1 Sep 2021 09:58:10 +0000 Received: from localhost ([127.0.0.1]:36388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLN0U-0007Bt-KX for submit@debbugs.gnu.org; Wed, 01 Sep 2021 05:58:10 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:34484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLN0P-0007B8-Nr for 50314@debbugs.gnu.org; Wed, 01 Sep 2021 05:58:09 -0400 Received: by mail-wr1-f43.google.com with SMTP id m9so3635152wrb.1 for <50314@debbugs.gnu.org>; Wed, 01 Sep 2021 02:58:05 -0700 (PDT) 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=KujdM5icew5kcPz+nVLoT4kuR7V2q3JUQu8I1FFh3Dk=; b=tRpud0XzoXtXTP7+rMXASeBbPCVPvCy1CUEqJzUSnonfKt9qbszrs8w9gg8LOyPg13 a38YPSCPvu7dpZprxZcP3dwvyOFIHWdDwpeD+4KlNjdUWNfTooayLS43KSom/6iKisih D/Jp0LrEhkr7JZuCamdUgzWcdQ8k2FTqkXUV7/EnQji5pcTQLL1wR/3JgoZqBCaNzol5 341GrJNO4d5X6tqKNAhQCR5QhvcKei+iFfIocxaDNihO7jdSSvaop0LXiTzPcWKRKeK9 STyCnCYv1DK76XIxtxqMglsKm+xrouomZMenjK4oxl5muFlJU2On0IOkRCEYfMB6tyHG vrgw== 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=KujdM5icew5kcPz+nVLoT4kuR7V2q3JUQu8I1FFh3Dk=; b=fZsZPOIvpQhxJE5mtuIZkmul78VPFoIRq75PyPPVGT4dfxxWBJb6ONlXE4dOleVD5F s6lf4V/9T5Yi82VF5k2Wuhdosru6nOCmz/skzkR9PDxMeWp/bf5AZhRAN1hBJBA4boOd RyJCd0vqJPoXfcaPXxCH1EzScqZEY20iNiwhIH5qjGdjBmWlX1P4F9+1AdAHGhOiQvre euPbboLTvppgorsdyWNuYQHGfwcXNoYa0XyzthZt18F+f/pQp/XuTNRPWLAB9jpF0B92 kWeU+BOFZXM0OEjLro3gbYmX3R08CagjAweU0ZEcrsHrcNyUSMyVnmDgQeszDCe2/Mke CM8A== X-Gm-Message-State: AOAM531DyeJSe4Pv5PKFesDBrARdy8o4Hta0/i5FBlEbPGz1vARwsQQr uu26ruW4BjywEktPWyeYjLG7ZCawfO3rqg== X-Google-Smtp-Source: ABdhPJxClBMG65rv8FJro9ag4Y8/EwY5NloNhNmhk7/hi9yhA1RB6+v5Fywe6dChMYViaE8YToiOPw== X-Received: by 2002:adf:c391:: with SMTP id p17mr37681814wrf.145.1630490279581; Wed, 01 Sep 2021 02:57:59 -0700 (PDT) Received: from lili.univ-paris-diderot.fr ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id v5sm21772535wru.37.2021.09.01.02.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 02:57:59 -0700 (PDT) From: zimoun Date: Wed, 1 Sep 2021 11:57:55 +0200 Message-Id: <20210901095756.13752-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 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630490352; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KujdM5icew5kcPz+nVLoT4kuR7V2q3JUQu8I1FFh3Dk=; b=b+Bjf6z6zftta9xjLFPAuI3+gM4eaxga+58uB3YEixbt85ip3A1mSMNqGFxdqX89sT+Csx sOgpoBKl8ovqk0W0b0fbtvxcsL7vz2nysOUgeR5hJXznDQkobAdOZ72j8wpMwKKDRr0hCO n/P8ZCDDGgilWduf1pNnzWs4H+GUDESmiHxtPbckSW2ZbcK7omr+JyjQw45dmVVRE9btVS CeS0RPbkM2I1b6wHNg4xkGgWfW9EJs2PNsKNdw3x63xtm6G0w0wKddFmNbRupbPy/sB4km tt1s819WfFoexjQDLFkRivrn0LfkgkajsmoE6eHibBHvEdlkXVYMrX3XTYnMnw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630490352; a=rsa-sha256; cv=none; b=BwlTm96s3Y682KGEVJYqWDyd+VETTj7ntV57V4OyBghSQPfo18eFxZOY4+9zjavkYirDSk jimiyD5YSWpmOVCSZiQhescY1Sckv7FlKUfm+xezjGq4Id6DCmNpepCLaSnUxTv4sARD2Z I5yw5YN9NnFPu8q6qb1jh56J6CdSitsNOvKJHHIvRamoq0ZTf/w9I29snOPT6RpTGPBnNt J+yRGnbUMPXc685zw46K4ecf2URQ/gep4TDmqyQUNyB8b13VwKcj4SZS5P1SMQshk7jrQz mUVaYZpVJUnex5716r+wh9ryIs9ix3uZCczcsJZyuyQGgM9vUPPV9fSqyi3Izg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=tRpud0Xz; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=tRpud0Xz; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (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-Migadu-Queue-Id: 2606E7FC2 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: u7aT+dXvXGGv * guix/scripts/import.scm (define-command): Add hint. --- guix/scripts/import.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index b369a362d0..11e94769bb 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 David Thompson ;;; Copyright © 2018 Kyle Meyer ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2021 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -130,4 +131,9 @@ Run IMPORTER with ARGS.\n")) expressions)) (x (leave (G_ "'~a' import failed~%") importer)))) - (leave (G_ "~a: invalid importer~%") importer))))) + (let ((hint (string-closest importer importers #:threshold 3))) + (report-error (G_ "~a: invalid importer~%") importer) + (when hint + (display-hint + (format #f (G_ "Did you mean @code{~a}?~%") hint))) + (exit 1)))))) -- 2.29.2