-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
python --help output is too long #90300
Comments
From Serhiy in https://mail.python.org/archives/list/[email protected]/thread/QUUBM7DGSXYWBOLZNWOSCQUDALWJIYZF/ :
Guido:
GvR again:
I would enjoy trying to make a patch around next week! |
Forgot to quote -X help to print help about X options. |
Do people think the man page should be shortened too? |
I think that the man page should contain all details related to the CLI (and may be even some examples). |
Question about the implementation: A) could add a value to the right struct for "-X help", set it in preconfig, handle it in initconfig (by printing X options help and exiting, maybe reusing the existing print help function or writing a very similar one next to it) Which option is best? |
It seems that preconfig is only for some options that change fundamental behaviour (isolated mode, default encoding), so I should be able to detect and handle '-X help' in initconfig. |
initconfig.c parses all -X options. preconfig.c also checks for a few specific -X options which are also checked in initconfig.c. My notes on parsing command line options: |
Victor said on github that he would prefer What do people think? |
"xoptions" name comes from sys._xoptions (Python) and PyConfig.xoptions (C). Oh, sys._xoptions is a private API... but it's mentioned in the -X documentation: |
I hard forgotten this bit in the email thread: Serhiy: What do you think about -hh (and maybe —help-full) printing full help? Guidp: Is there enough of a use case for this to bother? Barry: Maybe not. I’d say if it was easy to implement, why not, but if it’s a pain, don't bother. The option parsing code is easy to edit, and the function would only need to call the other usage functions with a blank line inbetween. Should I add it? |
Do you know other projects which dump the full help into stdout when asking for the "full help"? For me, the best CLI is "git help", "git help init", etc. "git help init" opens "man git-init". I don't know its behaviour on platforms without manpage support, like Windows. |
With Git for Windows, |
I don’t think that prior art applies here, as python does not have subcommands. |
BTW on the PR I am asking for help with string formatting, to print an invalid X option (a wchar_t string) using the PyStatus API (needs char). Help from a proper C programmer would be appreciated :) |
The PR now has --help-env, --help-xoptions and --help-all ! |
I have extracted some bugfixes to ticket #93217 |
Make --help output shorter and add new help options. --help-env, --help-xoptions and --help-all command-line options are added to complement --help.
…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 <[email protected]>
* document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
…15853) * document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions (cherry picked from commit b85572c) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
…17022) * document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions (cherry picked from commit b85572c) Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
…honGH-115853) (pythonGH-117022) * document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions (cherry picked from commit b85572c) (cherry picked from commit 4be9fa8) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
…ython CLI help Fix error introduced in 4be9fa8.
…17022) (GH-117034) * document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions (cherry picked from commit b85572c) (cherry picked from commit 4be9fa8) Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
* Fix the description of the "-b" option. * Add references to environment variables for "-s" and "-X dev" options.
* document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
* Fix the description of the "-b" option. * Add references to environment variables for "-s" and "-X dev" options.
* document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
* Fix the description of the "-b" option. * Add references to environment variables for "-s" and "-X dev" options.
* document equivalent command-line options for all environment variables * document equivalent environment variables for all command-line options * reduce the size of variable and option descriptions to minimum * remove the ending period in single-sentence descriptions Co-authored-by: Éric <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Linked PRs:
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: