On Mon, Dec 20, 2021 at 11:15 AM Brett Cannon <br...@python.org> wrote:
> > > On Sat, Dec 18, 2021 at 4:00 PM Guido van Rossum <gu...@python.org> wrote: > >> On Sat, Dec 18, 2021 at 2:16 PM Serhiy Storchaka <storch...@gmail.com> >> wrote: >> >>> The output of "python -h" is 104 lines long now. It was only 51 lines in >>> 3.6. 35% of it is about the -X option, and 30% about environment >>> variables. Also some lines in the -X option description are too long >>> (102 columns). Both topics are "advanced" and mostly interested for >>> debugging. I suggest to move them out of the main help output. >>> >> >> Sounds like a good plan. >> >> >>> The are two options: >>> >>> 1. Move it to pydoc topics. The advantage is that it is a standard way, >>> there are already 88 topics. The disadvantage is that this information >>> will be not available in "minimal" installations of Python which do not >>> include docs. >>> >>> 2. Add command-line options like -hX and -henv. The information will >>> always be available with the interpreter, but the interface is special. >>> >> >> For -X, I suggest we could output the following line: >> >> -X opt : implementation-specific option; use -X help to list options. >> > > +1 from me. > > >> >> We could also see if we can put the help text for each of the supported >> -X flags in the table defining these flags (sorry, I can't recall where it >> lives, but I'm pretty sure I've seen such a table.) >> >> For env vars I think moving this to pydoc is fine; I don't think we have >> a process or mechanism that ensures the docs for env vars are even >> complete. (We don't have one for the flags either, but somehow I find it >> hard to conceive of someone adding a new command line flag without them or >> someone else involved in the code review thinking of updating the help >> text. But I find it quite conceivable that someone adds a new env var used >> only in a corner case without anyone thinking to update the docs. And I >> presume that the -E flag isn't honored 100% of the time either.) >> >> But I wouldn't object to a -h sub-option that lists environment vars >> either. >> > > I think an option to `-h` for environment variables is also good as that > command can be the generic `-h` output as well without resorting to needing > to run Python code like pydoc to get at more help. > Fair enough. Quick design proposal: -h and --help print info about flags (existing flags) --help-env (or --env-help?) prints info about env vars (new flag) -X help prints info about -X options (new -X option) Two lines printed at the end of the -h/--help output would refer users to --help-env and -Xhelp. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/NF4LTZWAMOATEA4ZZLIGVIJOATVIYMF2/ Code of Conduct: http://python.org/psf/codeofconduct/