-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
argparse says argument is optional when it's required #8055
Comments
Note that this isn't a minimal repro; I'll work on paring it down on Monday. |
Thanks, we'll look into it when we find the time, though it may take a while with 27-rc1 and 26.3 coming up soon, so we'd welcome a PR if anyone's inclined :) |
I might get to it next week, but no promises. |
I've spent fair amount of time today on When printing help message, would it make sense to split arguments based on the "required" value, rather than by "is it positional or optional"? Also renaming "optional arguments" to "option" or "option argument" could make confusion smaller. What I also found strange is that in I think it's suitable to ping the author here @max-au EDIT: |
Now I see how this feature (allowing options to be
I'm fine with this change, although, as soon as the code has been contributed, the decision must be approved by the OTP team.
Oh, that's indeed a (copy-pasted) typo :-D the actual test is below, for |
As for that, I don't have an opinion. Original implementation was based on the premise of sorting arguments into positional and optional (prefixed). Migrating existing apps to |
The problem with positional arguments is that you need to remember which order they come in. Whereas if you consider the It's not positional vs. optional. It's positional vs. named. Positional arguments can also be optional (i.e. if you just omit the Nth, N-1th, etc. arguments, use defaults). |
Describe the bug
Usage text for 'required' arguments has them listed under "Optional arguments".
To Reproduce
Usage reads thus:
Expected behavior
Usage should probably read thus:
Affected versions
OTP-26.2.1
The text was updated successfully, but these errors were encountered: