--- Begin Message ---
Subject: |
[PATCH 0/2] DRAFT: Hint for options. |
Date: |
Fri, 15 Jan 2021 17:37:32 +0100 |
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
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#45893: [PATCH 0/2] DRAFT: Hint for options. |
Date: |
Wed, 03 Feb 2021 12:28:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi!
zimoun <zimon.toutoune@gmail.com> 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’.
--- End Message ---