GNU bug report logs -
#45893
[PATCH 0/2] DRAFT: Hint for options.
Previous Next
Reported by: zimoun <zimon.toutoune <at> gmail.com>
Date: Fri, 15 Jan 2021 16:38:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 03 Feb 2021 12:28:43 +0100
with message-id <877dnpbdas.fsf_-_ <at> gnu.org>
and subject line Re: bug#45893: [PATCH 0/2] DRAFT: Hint for options.
has caused the debbugs.gnu.org bug report #45893,
regarding [PATCH 0/2] DRAFT: Hint for options.
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
45893: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45893
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
Hi!
zimoun <zimon.toutoune <at> 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’.
This bug report was last modified 4 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.