GNU bug report logs - #46308
[PATCH 0/1] Fix 2 corner cases for option hint

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Thu, 4 Feb 2021 23:01: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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#46308: closed ([PATCH 0/1] Fix 2 corner cases for option hint)
Date: Wed, 24 Feb 2021 22:52:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 24 Feb 2021 23:51:53 +0100
with message-id <877dmx2i5y.fsf_-_ <at> gnu.org>
and subject line Re: bug#46308: [PATCH 0/1] Fix 2 corner cases for option hint
has caused the debbugs.gnu.org bug report #46308,
regarding [PATCH 0/1] Fix 2 corner cases for option hint
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
46308: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46308
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: zimoun <zimon.toutoune <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH 0/1] Fix 2 corner cases for option hint
Date: Fri,  5 Feb 2021 00:00:28 +0100
Hi,

First,

--8<---------------cut here---------------start------------->8---
$ guix package --shw=hello
guix package: error: shw=hello: unrecognized option
--8<---------------cut here---------------end--------------->8---

becomes

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix package --shw=hello
guix package: error: shw=hello: unrecognized option
hint: Did you mean `show'?
--8<---------------cut here---------------end--------------->8---

And second the ugly (introduced by ’option’hint):

--8<---------------cut here---------------start------------->8---
$ guix package -Z
Backtrace:
          11 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
  2162:12 10 (run-guix-command _ . _)
In guix/scripts/package.scm:
   1075:2  9 (guix-package . _)
In ice-9/boot-9.scm:
  1731:15  8 (with-exception-handler #<procedure 7fc66e356f00 at ice-9/boot-9.scm:1815:7 (exn)> _ # _ …)
In srfi/srfi-37.scm:
   113:18  7 (next-arg)
In unknown file:
           6 (_ #<procedure 7fc66e356ea0 at srfi/srfi-37.scm:114:22 ()> #<procedure list _> #<hash-t…>)
In guix/scripts.scm:
    121:2  5 (_ _ #\Z _ . _)
In guix/utils.scm:
    920:4  4 (string-closest _ _ #:threshold _)
In guix/combinators.scm:
    46:26  3 (fold2 #<procedure 7fc66e24a660 at guix/utils.scm:920:11 (test closest minimal)> #f # (…))
In guix/utils.scm:
   921:25  2 (_ "help" #f +inf.0)
   911:12  1 (string-distance #\Z "help")
In unknown file:
           0 (string->list #\Z #<undefined> #<undefined>)

ERROR: In procedure string->list:
In procedure string->list: Wrong type argument in position 1 (expecting string): #\Z
--8<---------------cut here---------------end--------------->8---

is fixed:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix package -Z
guix package: error: Z: unrecognized option
--8<---------------cut here---------------end--------------->8---


A corner case is still missing:

        $ ./pre-inst-env guix environment -ah-hoc hello
        guix environment: error: a: unrecognized option

where it could be nice to hint for.  But from my understanding, it is not possible with SRFI-37.


All the best,
simon

zimoun (1):
  guix: scripts: Fix corner cases of hint for option typo.

 guix/scripts.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)


base-commit: 5ae09d7979a0696d862b9555314eab199f7ce576
-- 
2.29.2



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 46308-done <at> debbugs.gnu.org
Subject: Re: bug#46308: [PATCH 0/1] Fix 2 corner cases for option hint
Date: Wed, 24 Feb 2021 23:51:53 +0100
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> * guix/scripts.scm (option-hint): Fix corner cases.

Applied!  I also reverted the change I made in
11f11d7ecb817d1421f8b5340bcced59396d8708, which addressed the
short-option problem you mention.

Thanks,
Ludo’.


This bug report was last modified 4 years and 89 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.