Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Did you mean" hint on wrong command or flag #895

Closed
saschagrunert opened this issue Sep 13, 2019 · 13 comments · Fixed by #977 or #1390
Closed

"Did you mean" hint on wrong command or flag #895

saschagrunert opened this issue Sep 13, 2019 · 13 comments · Fixed by #977 or #1390
Labels
area/v2 relates to / is being considered for v2 kind/feature describes a code enhancement / feature request status/confirmed confirmed to be valid, but work has yet to start
Milestone

Comments

@saschagrunert
Copy link
Member

We could tell the user what the closest command or argument match is by calculating the levenshtein distance between them.

What to do you think?

@AudriusButkevicius
Copy link
Contributor

Should be optional tho

@saschagrunert saschagrunert added the kind/feature describes a code enhancement / feature request label Sep 14, 2019
@asahasrabuddhe
Copy link
Member

Good idea for a new feature. I always loved how git suggests this to us in case of a typo. I also agree that this needs to be optional where a user can enable this probably by a boolean flag if they feel they need it for their CLI.

@coilysiren
Copy link
Member

I'd love this!!!

@coilysiren coilysiren added the status/confirmed confirmed to be valid, but work has yet to start label Sep 16, 2019
@coilysiren
Copy link
Member

Related to the conversation in #826, I'd like to propose we only consider this feature for v2 🙏

@saschagrunert
Copy link
Member Author

Sounds good, I suggest to use a third party library to provide the necessary algorithms around it.

@coilysiren
Copy link
Member

Sounds good, I suggest to use a third party library to provide the necessary algorithms around it.

I'm in strong agreement here!

@saschagrunert
Copy link
Member Author

I found three main packages which all seem a bit unmaintained:

From an implementation perspective I tend to use the Jaro-Winkler distance to match the closet command/flag.

To start with a clean state I added go module support to matchr: antzucaro/matchr#10

@coilysiren coilysiren added the area/v2 relates to / is being considered for v2 label Nov 27, 2019
@stale
Copy link

stale bot commented Feb 25, 2020

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

@stale stale bot added the status/stale stale due to the age of it's last update label Feb 25, 2020
@stale
Copy link

stale bot commented Mar 26, 2020

Closing this as it has become stale.

@stale stale bot closed this as completed Mar 26, 2020
@coilysiren coilysiren reopened this Mar 30, 2020
@stale
Copy link

stale bot commented Mar 30, 2020

This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant.

@stale stale bot removed the status/stale stale due to the age of it's last update label Mar 30, 2020
@coilysiren
Copy link
Member

This issue has a PR here! => #977

@stale
Copy link

stale bot commented Jun 28, 2020

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

@stale stale bot added the status/stale stale due to the age of it's last update label Jun 28, 2020
@stale
Copy link

stale bot commented Jul 29, 2020

Closing this as it has become stale.

@stale stale bot closed this as completed Jul 29, 2020
@meatballhat meatballhat reopened this Apr 22, 2022
@meatballhat meatballhat removed the status/stale stale due to the age of it's last update label Apr 22, 2022
@meatballhat meatballhat changed the title Feature: "Did you mean" hint on wrong command or flag "Did you mean" hint on wrong command or flag Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/feature describes a code enhancement / feature request status/confirmed confirmed to be valid, but work has yet to start
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants