-
Notifications
You must be signed in to change notification settings - Fork 56
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
Better error message about missing arguments for subcommands #39
Comments
Well obviously the |
Also a fully reproducible test case would be nice. |
I think from a user point of view we should simply report all missing required arguments, not stop at the first one. |
Agreed, I'd prefer a report of all missing required arguments if that's reasonable. If only one is reported then the first missing would be nice to have. |
I'll supply you with reproducible examples after holidays, okay? I'm a little bit busy now. |
I'd say that the usage line only allows you to see at which position the missing arguments are due. If the error message only tells you "required argument PKGNAME is missing" your brain will likely focus to fill in PKGNAME, failing to realize other required arguments are missing. In other words it's a misleading error message that will likely bring you to a new erroring interaction. If the error is "required arguments PKGNAME, VERSION and PLATFORM are missing", you'll be more likely to take care to try to fill in all the arguments and the usage line will help you figure out at which position the arguments are due. |
In fact the problem is even worse: the actual argument that is reported depends on the way you construct your term. |
This should be fixed, all missing required arguments should be reported, in order. Thanks for the report. |
This introduced the regression that we can no longer as for |
Obviously it should be reported about the missing argument PKGNAME.
I suppose the problem is in intertal command matching. Cmdliner sees that the 3rd parameter of command is missed. And reported that there's not the 3rd parameter of subcommand in the error message.
The code to reproduce it:
and eventually:
The text was updated successfully, but these errors were encountered: