opam
opam copied to clipboard
Add package spelling hints
This PR adds hints when package names contain typos. When the package is not found, string edit distance is used to spellcheck the name and the closest package is printed to the user.
Currently hinted commands :
- [x] remove
- [x] info/show
- [x] source
- [x] install
- [x] upgrade
- [x] reinstall
- [x] pin (version/current/dev/edit)
- [x] tree
- [x] lock
- [x] switch set-invariant
$./opam source ocamlforat
[ERROR] No package matching ocamlforat found.
Hint: Did you mean ocamlformat?
Multi-hints:
$./opam info ocamlforat opclib-endian baze
[ERROR] No package matching ocamlforat or opclib-endian or baze found
Hint: Did you mean ocamlformat?
Hint: Did you mean ocplib-endian?
Hint: Did you mean bare?
closes #4029
Added hints for :
pin : edit, --dev-repo --current
remove —force (unforced remove is already covered).