-
Notifications
You must be signed in to change notification settings - Fork 366
add an example of finding close matches #1152
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
base: main
Are you sure you want to change the base?
Conversation
That looks OK, but I'd really love some simple API to enable that behaviour. |
I like that. Something like this could be a great help to the user of our apps. I'm wondering, however, if the prefix match could also be implemented for the parser itself - basically as long as the prefix is unambiguous, the corresponding command would be used. Kinda-sorta what NPM does, but better ( |
I added prefix matching modifier to the app class, That will work for prefix matching on subcommands. I will add some more documentation and a few more tests yet, but review comments/suggestions would be appreciated. |
Well, for me that looks beautiful! |
I integrated prefix matching and the example has the close matching output. @henryiii what do you think of the prefix matching. I am not ready to integrate the close matching as a standard feature available that will take a different PR. But I think the prefix matching is ready or close to merging. |
@henryiii need your thoughts on this one |
@phlptp Thanks for taking this up so quickly! Just to check, should this PR be prefix-match only?
Based on your comment, should the "close match"/Levenshtein material be removed? |
Right now the close match/levenshtein matching is in an example and the test is against that example. The comment was referring to trying to get that capability into the main files, which I am not ready to try yet. But I am fine with it being in an example of how that might be done. I want to get the prefix matching in first then start thinking about what the best way of including the close match stuff into the main header files, or whether or not that should be included at all. |
@henryiii Going to merge this in two days unless you have further comments. |
continue discussion on #1149
Adds subcommand prefix matching as a modifier to CLI.
Adds and example of close matching logic for further exploration.