hg-canttype: mercurial extension for bad typists
Corrects simple typing errors in commands using Damerau-Levenshtein distance.
Ever typed hg dfif, hg doff or hg banrch? This fixes that.
Some examples of how it helps:
$ hg dfif Correcting 'dfif' to 'diff' $ hg brnch Correcting 'brnch' to 'branch'
Installation & Setup
Installing hg-canttype is simple:
$ pip install hgcanttype
Setup is easy too, just add hgcanttype to your hgrc:
[extensions] hgcanttype=
You can configure the distance to consider a command “close enough” like so:
[canttype] distance = 5
The default is 1. Take note that setting the distance too high is a bad idea:
$ hg dfif Correcting 'dfif' to 'help'
You can also configure the plugin to provide suggestions rather than automatically correcting the command, just like git:
$ hg dfif
hg: unknown command 'dfif'
Did you mean this?
diff
This is easy to configure:
[canttype] suggest = true
Note that it will automatically do this if it finds more than one command, even if you have suggestions turned off:
$ hg cu
hg: unknown command 'cu'
Did you mean this?
ci
cp
co
License
As this is a derived work of the Mercurial project, the license is GPLv2+ as per the Mercurial License page.
Change History
- 1.0.8 (4th April 2014)
Fix indexing error when not using suggestions
- 1.0.7 (4th April 2014)
Don’t recommend the same command multiple times
- 1.0.6 (24th March 2014)
I hate Restructured Text
- 1.0.5 (24th March 2014)
Provide suggestions if multiple matches were found.
Provide suggests all the time if [canttype]/suggest = true.
- 1.0.4 (12th March 2014)
Handle no command being passed in. Thank you, Andrew Taumoefolau!
- 1.0.3 (11th March 2014)
Removed pointless print statement
- 1.0.2 (10th March 2014)
Fix more typos…
- 1.0.1 (10th March 2014)
Fix typos. The irony.
- 1.0.0 (10th March 2014)
Initial release
Metadata
Release files for hgcanttype 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hgcanttype-1.0.8.tar.gz | 3.2 kB | Without provenance | Details for hgcanttype-1.0.8.tar.gz |
Release files / hgcanttype-1.0.8.tar.gz
| Download URL | hgcanttype-1.0.8.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f18016946c143c193db0a1e3a917dcc867a270a4d5ac6a85094f27bbcb100f5f
|
|
BLAKE2b-256 checksum How to use checksums |
addc20e37e595245ca2dbd9aa6f7c2bb717f528ac91ab1b28c13a61f40f97fb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for hgcanttype 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.