-
Notifications
You must be signed in to change notification settings - Fork 124
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
Provide better error when command is wrong #361
Comments
Thanks for the report! This happens because, in order to support |
Ah, I was suspecting something like this. Rather than choosing the "best" one after gathering all, maybe it's better to sort them by "best guess" and list all. Let the user decide how bad it is, instead of hiding. |
I implemented this in the I'm not currently reporting more than one error, since errors after the first are often spurious. As in your example, if someone mistypes a subcommand name, it's probably not helpful to report an error for every option and argument after that. But if you have a use case for it, feel free to open another issue to discuss. |
Compare these two experiences:
The first one is really good, it actually tells me that there isn't a command like this, it even suggests a close-enough match in case of typos. However the second one gives a misleading error message suggesting that the parameter is wrong, when the command name is mis-spelled or otherwise non-existent.
Is it possible to get the same error message as the first one for the second case too? (i.e. validate command first, and then try parsing params)
Affected versions: 2.5.0, 3.5.0
The text was updated successfully, but these errors were encountered: