Subject: bug#45893: closed (Re: bug#45893: [PATCH 0/2] DRAFT: Hint for options.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 03 Feb 2021 11:30:03 +0000

Your bug report

#45893: [PATCH 0/2] DRAFT: Hint for options.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
45893: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45893
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#45893: [PATCH 0/2] DRAFT: Hint for options.
From: Ludovic Courtès <[email-masked]>
To: zimoun <[email-masked]>
Cc: [email-masked]
Date: Wed, 03 Feb 2021 12:28:43 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi!

zimoun <[email-masked]> skribis:

> Well, I have implemented [1] the full matrix version, almost copy/paste
> from Wikipedia [2]. :-) Ugly, isn’t it!

Yup! :-)

> Let merge and improve if required, IMHO.  As Arun mentioned in the
> «improving “guix search”» thread, maybe it is worth to give a look at
> the Guile string library.

I went ahead and applied the three patches.  I took the liberty to make
two changes:

  1. Changed “Do you mean” to “Did you mean”;

  2. Display hints after errors, as is done elsewhere.

It’s really pleasant!

(I thought: when one types “guix clone”, should we suggest “git clone”? :-))

Thanks!

Ludo’.

Subject: [PATCH 0/2] DRAFT: Hint for options.
From: zimoun <[email-masked]>
To: [email-masked]
Cc: zimoun <[email-masked]>
Date: Fri, 15 Jan 2021 17:37:32 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

The first patch uniformize.  If this proposal is ok, then more Guix scripts
have to be replaced; so the v2 could do that.

The second patch is the interesting one.  The naive implementation of Levenshtein
distance by recursion is enough here when memoize is applied.  However, the 'car'
and 'cdr' is not in the Guix style, feedback welcome.

Maybe abuse of fold, again feeback welcome.

Well, the current result is:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix show --lead-paht hello
hint: Do you mean `load-path'?

guix show: error: lead-paht: unrecognized option
--8<---------------cut here---------------end--------------->8---

All the best,
simon

zimoun (2):
  scripts: search, show: Replace 'args-fold*' by 'parse-command-line'.
  guix: scripts: Add hint for option typo.

 guix/scripts.scm        | 58 +++++++++++++++++++++++++++++++++++++++++
 guix/scripts/search.scm |  7 ++---
 guix/scripts/show.scm   |  8 ++----
 3 files changed, 62 insertions(+), 11 deletions(-)

base-commit: c03875b0361f114634caeb54935fe37a9b7b05af
-- 
2.29.2