When I spoted this hgcanttype Python package, I sort of expected what it would do, and I felt kind of interesting.
Since you have this in Git:
$ git difi git: 'difi' is not a git command. See 'git --help'. Did you mean this? diff
But not in Mercurial:
$ hg difi hg: unknown command 'difi' [a short help message for common commands list]
In Mercurial with hgcanttype:
$ hg difi Correcting 'difi' to 'diff'
I think this is a good idea but not the way it does, I’d like it only suggests as Git does, not directly run the corrected command.
GPLv2 License, you can view the source code on Bitbucket. The installation is easy, just install the package via pip, then enable the extension in hgrc, you can also adjust the Damerau-Levenshtein distance:
[extensions] hgcanttype= [canttype] distance = 3
I don’t think I’d need this but someone who types really badly might need this, although I don’t know if it’s a good idea for a bad typist to have this. Someone might need to do a research on all commands’ distances to make sure no harm could be done.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.