[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/07: import: Add hint for importer typo.
From: |
guix-commits |
Subject: |
02/07: import: Add hint for importer typo. |
Date: |
Tue, 7 Sep 2021 10:09:29 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 1cf866c863e38bc2a61077e38f416fe3d310e340
Author: zimoun <zimon.toutoune@gmail.com>
AuthorDate: Wed Sep 1 11:57:55 2021 +0200
import: Add hint for importer typo.
* guix/scripts/import.scm (define-command): Add hint.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
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 b369a36..11e9476 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2014 David Thompson <davet@gnu.org>
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; 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))))))
- branch master updated (5cfe5dd -> 3d42aa3), guix-commits, 2021/09/07
- 02/07: import: Add hint for importer typo.,
guix-commits <=
- 01/07: gnu: racket-minimal: Remove top-level reference to 'chez-scheme'., guix-commits, 2021/09/07
- 04/07: import: elpa: Support NonGNU ELPA., guix-commits, 2021/09/07
- 07/07: gnu: mandoc: Add $MANPATH to native-search-paths., guix-commits, 2021/09/07
- 06/07: emacs-org-roam: Add new phase after unpack., guix-commits, 2021/09/07
- 03/07: system: Add hint for action typo., guix-commits, 2021/09/07
- 05/07: import: go: Fix import when import path redirects., guix-commits, 2021/09/07