mbox series

[bug#50314,0/2] Add hint typo for importers and system actions

Message ID 20210901095538.12813-1-zimon.toutoune@gmail.com
Headers show
Series Add hint typo for importers and system actions | expand

Message

Simon Tournier Sept. 1, 2021, 9:55 a.m. UTC
Hi,

Instead of,

        $ guix import pypy foo
        guix import: error: pypy: invalid importer

it becomes

        $ ./pre-inst-env guix import pypy foo
        guix import: error: pypy: invalid importer
        hint: Did you mean `pypi'?

And thanks to Sarah, the --options are also hinted (when typo).

Note that it is not possible to guess which importer is between 'cpan' and
'cran' for the typo 'can'.  The first from the list 'importers' is returned,
i.e., 'cpan'.

Last, instead of

        $ guix system sarch cuirass
        guix system: error: sarch: unknown action

it becomes

        $ ./pre-inst-env guix system sarch cuirass
        guix system: error: sarch: unknown action
        hint: Did you mean `search'?


All the best,
simon


zimoun (2):
  import: Add hint for importer typo.
  system: Add hint for action typo.

 guix/scripts/import.scm |  8 +++++++-
 guix/scripts/system.scm | 31 ++++++++++++++++++++-----------
 2 files changed, 27 insertions(+), 12 deletions(-)


base-commit: 1a657497acdead9afbeb24db6102f645d7e28ac9

Comments

Ludovic Courtès Sept. 7, 2021, 1:51 p.m. UTC | #1
Hello!

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

> Instead of,
>
>         $ guix import pypy foo
>         guix import: error: pypy: invalid importer
>
> it becomes
>
>         $ ./pre-inst-env guix import pypy foo
>         guix import: error: pypy: invalid importer
>         hint: Did you mean `pypi'?
>
> And thanks to Sarah, the --options are also hinted (when typo).

[...]

>         $ ./pre-inst-env guix system sarch cuirass
>         guix system: error: sarch: unknown action
>         hint: Did you mean `search'?

Nice!

>   import: Add hint for importer typo.
>   system: Add hint for action typo.

Applied, thanks!  :-)

Ludo’.