-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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 "usage" overly-complex with nargs="*" #82619
Comments
This program: import argparse
ap = argparse.ArgumentParser()
ap.add_argument("arg", nargs="*")
ap.parse_args() Gives usage message: It's correct, but unnecessarily complex and challenging to the user. |
I think [arg ...] would make sense. Removing 3.5 and 3.6, since they're in security only mode. Adding 3.9. |
Bob, would like to create a PR? |
I’m happy to write one. This seems like a pretty straightforward fix. |
Bob, as OP you get first dibs on a PR. |
The
|
For backward compatibility with 2 metavars, the two-name form should still be possible. Just pass metavar=("FOO", "FOO"). |
I don't think it's any more precise. It just seems verbose and confusing to me, while conveying the same information.
While So, I'd vote for the simpler version, especially since we're presumably trying to communicate with people who aren't BNF or regex experts! |
I went ahead and opened a PR, since it's been a month. |
Bob, thanks for the suggestion. Brandt, thanks for the PR. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: