-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
gh-90300: split --help output into separate options #30331
Conversation
] | ||
[ | ||
.B \-X help | ||
] |
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.
I thought showing all help options on their own line could be nice.
When you're done making the requested changes, leave the comment: |
Thanks for working on this! I left some comments and suggestions. |
@@ -2085,7 +2106,7 @@ config_read(PyConfig *config, int compute_path_config) | |||
/* -X options */ | |||
const wchar_t* option = _Py_check_xoptions(&config->xoptions, known_xoptions); | |||
if (option != NULL) { | |||
return PyStatus_Error("Unknown value for option -X"); | |||
return PyStatus_Error("Unknown value for option -X (see --help-xoptions)"); | |||
} |
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.
Turns out that showing the invalid value in this error message is not trivial: real C programmers had issue with it too before #28823
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\ |
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.
--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!).
-X opt : set implementation-specific option\n\ | |
-X opt : set implementation-specific option (see --help-xoptions)\n\ |
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.
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 🙂
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. |
Thanks @merwok for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-93413 is a backport of this pull request to the 3.11 branch. |
🎉 Thanks for seeing this through, @merwok! It's a nice improvement. 😄 |
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.