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?
Should be optional tho
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.
I'd love this!!!
Related to the conversation in https://github.com/urfave/cli/issues/826, I'd like to propose we only consider this feature for v2 馃檹
Sounds good, I suggest to use a third party library to provide the necessary algorithms around it.
Sounds good, I suggest to use a third party library to provide the necessary algorithms around it.
I'm in strong agreement here!
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: https://github.com/antzucaro/matchr/pull/10
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.
Closing this as it has become stale.
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.
This issue has a PR here! => https://github.com/urfave/cli/pull/977
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.
Closing this as it has become stale.