FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-90300: split --help output into separate options by merwok · Pull Request #30331 · python/cpython · GitHub

Repository navigation

gh-90300: split --help output into separate options - #30331

Merged
merwok merged 33 commits into
python:mainfrom
merwok:shorten-help-output
Jun 1, 2022
Merged

merwok merged 33 commits into
python:mainfrom
merwok:shorten-help-output

Conversation

merwok commented Jan 2, 2022 •
edited
Loading

Copy link
Copy Markdown
Member

gh-90300: Make --help output shorter and add new help options.

--help-env, --help-xoptions and --help-all command-line options are
added to complement --help.

Comment thread Python/initconfig.c Outdated
Comment thread Python/initconfig.c
Comment thread Python/initconfig.c Outdated
Comment thread Python/initconfig.c Outdated
merwok marked this pull request as ready for review January 2, 2022 23:16
merwok changed the title bpo-46142: make python --help output shorter [WIP] bpo-46142: split --help output into separate options Jan 2, 2022
Comment thread Lib/test/test_cmd_line.py Outdated
Comment thread Misc/python.man
Comment thread Misc/python.man
]
[
.B \-X help
]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I thought showing all help options on their own line could be nice.

Comment thread Python/initconfig.c Outdated
Comment thread Python/initconfig.c Outdated
merwok requested a review from warsaw January 3, 2022 15:28
Comment thread Doc/using/cmdline.rst Outdated
Comment thread Doc/using/cmdline.rst Outdated
Comment thread Lib/test/test_cmd_line.py Outdated
Comment thread Python/initconfig.c Outdated
Comment thread Python/initconfig.c Outdated
Comment thread Python/initconfig.c
Comment thread Python/initconfig.c Outdated

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

warsaw commented Jan 3, 2022

Copy link
Copy Markdown
Member

Thanks for working on this! I left some comments and suggestions.

merwok linked an issue May 25, 2022 that may be closed by this pull request
Comment thread Python/initconfig.c Outdated
Comment thread Python/initconfig.c
if (option != NULL) {
return PyStatus_Error("Unknown value for option -X");
return PyStatus_Error("Unknown value for option -X (see --help-xoptions)");
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Turns out that showing the invalid value in this error message is not trivial: real C programmers had issue with it too before #28823

Comment thread Python/initconfig.c
when the interpreter displays tracebacks.\n\
-X frozen_modules=[on|off]: whether or not frozen modules should be used.\n\
The default is \"on\" (or \"off\" if you are running a local build).\n\
-X opt : set implementation-specific option\n\

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

--help-xoptions is listed a few items below, but if scanning the list it might be helpful to explicitly mention it here. (Sorry if it's been suggested before & declined!).

Suggested change
-X opt : set implementation-specific option\n\
-X opt : set implementation-specific option (see --help-xoptions)\n\

merwok May 30, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I’ve added it and removed it. In the current version, I think it is not needed, as it is a few lines later and in the man page and shown in error message for unknown X option, but have no problem adding it if someone adds 👍🏽 to your comment 🙂

merwok commented May 31, 2022 •
edited
Loading

Copy link
Copy Markdown
Member Author

This is ready and complete for me. I did not change all lines to be <80 columns like Serhiy requested, but the upside is that the diff size is very reasonable. I would like to merge this week-end, or sooner if there are approving reviews, then create the backport PR for 3.11.

merwok added needs backport to 3.11 only security fixes 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels May 31, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @merwok for commit 5485255 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 31, 2022
merwok merged commit 8aa9d40 into python:main Jun 1, 2022

Copy link
Copy Markdown
Contributor

Thanks @merwok for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

merwok deleted the shorten-help-output branch June 1, 2022 09:50
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2022
…0331)

Make --help output shorter and add new help options.

--help-env, --help-xoptions and --help-all command-line options are
added to complement --help.
(cherry picked from commit 8aa9d40)

Co-authored-by: Éric <earaujo@caravan.coop>
bedevere-bot removed the needs backport to 3.11 only security fixes label Jun 1, 2022

Copy link
Copy Markdown

GH-93413 is a backport of this pull request to the 3.11 branch.

Copy link
Copy Markdown
Member

🎉 Thanks for seeing this through, @merwok! It's a nice improvement. 😄

miss-islington added a commit that referenced this pull request Jun 14, 2022
Make --help output shorter and add new help options.

--help-env, --help-xoptions and --help-all command-line options are
added to complement --help.
(cherry picked from commit 8aa9d40)

Co-authored-by: Éric <earaujo@caravan.coop>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python --help output is too long

Back | FazBrowse Home | New Git URL