Add a "Did you mean?" prompt if user misspells example name, and optionally re-run if the user says "Yes!" #17
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Is your feature request related to a problem? Please describe.
I don't know if it's possible but I'd like to suggest auto-correction if a user misspells or mistypes an example name, similar to how
cargo run --example
does it already currently.Related Issues
#18
Describe the solution you'd like
Potentially something like:
Describe alternatives you've considered
I haven't actually looked into any existing solutions for spelling correction yet. It would be cool to implement this, I feel. Preferably with the least overhead in terms of overall dependency size, compilation or build time, etc.
Additional context
It's not too necessary as when we call
cargo run --example
, it'll already offer an auto correction hint. But I think it's nice to add proactive spellchecking and correction -- this way it'll be a little faster, as we can catch the error earlier, and we don't need to waste time spawning a new process to callcargo run --example
when we already know the example name is misspelled, for example.Just for completeness sake, Here's a sample auto correction hint from
cargo run --example
on one of my projects, which I think is really cool/nice:The text was updated successfully, but these errors were encountered: