-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-101599: changed argparse -h/-help flag for the sake of readability #103372
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
Conversation
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the parts
variable can now be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you for your contribution @Jokimax.
…103372) If the option with argument has short and long names, output argument only once, after the long name: -o, --option ARG description instead of -o ARG, --option ARG description
…103372) If the option with argument has short and long names, output argument only once, after the long name: -o, --option ARG description instead of -o ARG, --option ARG description
Python 3.13 changes the formatting of long-short option pairs that use a meta-variable. Up until 3.13 the meta-variable was repeated. Since Python change [1] the meta-var is only printed once. [1] python/cpython#103372 Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com> (cherry picked from commit 6336465) Signed-off-by: John Johansen <john.johansen@canonical.com>
Python 3.13 changes the formatting of long-short option pairs that use a meta-variable. Up until 3.13 the meta-variable was repeated. Since Python change [1] the meta-var is only printed once. [1] python/cpython#103372 Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com> MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1495 Approved-by: Georgia Garcia <georgia.garcia@canonical.com> Approved-by: Christian Boltz <apparmor@cboltz.de> Merged-by: Zygmunt Krynicki <me@zygoon.pl> (cherry picked from commit 219626c)
argparse
Prints options per flag name when only once is necessary #101599