-
Notifications
You must be signed in to change notification settings - Fork 11
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 handling of required option without a default #66
Comments
I ran into this problem. Let's look at an example with 2 options:
I currently have 2 options. My first option is to make the parameter required, but not specify a default value. In which case an exception is thrown in the generated code if the parameter is missing:
My second option is to make the parameter required and specify an empty default value. In this case I have to validate the argument manually - it's okay and works - , but the bigger problem is that the help does not tell me that the parameter is mandatory:
The 'args' package already supports the "mandatory" flag ('build_cli_annotations' does not), but this is not a complete solution either:
The problem is that in this case the help does not work:
Perhaps a solution would be to make 'build_cli_annotations' support the use of the 'mandatory' flag, and to somehow allow the precedence of the help option to be raised above the mandatory flagged options. But the latter would have to be done in the 'args' package not in the 'build_cli' package. |
It seems that
to
We can have a better error message. |
Warn during generation?
Improve error when parsing?
The text was updated successfully, but these errors were encountered: