summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-03-13 20:59:16 (GMT)
committerGitHub <noreply@github.com>2024-03-13 20:59:16 (GMT)
commit8c6db45ce34df7081d7497e638daf3e130303295 (patch)
treeccfd654fbec8be36ef7bce5ab109b9adc54ad849
parent61733a2fb9dc36d2246d922146a3462a2248832d (diff)
downloadcpython-8c6db45ce34df7081d7497e638daf3e130303295.zip
cpython-8c6db45ce34df7081d7497e638daf3e130303295.tar.gz
cpython-8c6db45ce34df7081d7497e638daf3e130303295.tar.bz2
gh-90300: Document equivalent -X options for envvars in the Python CLI help (GH-116756)
-rw-r--r--Python/initconfig.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c
index 020312a..f365bee 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -259,18 +259,11 @@ static const char usage_envvars[] =
" The default module search path uses %s.\n"
"PYTHONPLATLIBDIR: override sys.platlibdir.\n"
"PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
-"PYTHONUTF8 : if set to 1, enable the UTF-8 mode.\n"
"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n"
-"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"
"PYTHONHASHSEED : if this variable is set to 'random', a random value is used\n"
" to seed the hashes of str and bytes objects. It can also be\n"
" set to an integer in the range [0,4294967295] to get hash\n"
" values with a predictable seed.\n"
-"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
-" when converting from a string and when converting an int\n"
-" back to a str. A value of 0 disables the limit.\n"
-" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
-" limited.\n"
"PYTHONMALLOC : set the Python memory allocators and/or install debug hooks\n"
" on Python memory allocators. Use PYTHONMALLOC=debug to\n"
" install debug hooks.\n"
@@ -281,47 +274,56 @@ static const char usage_envvars[] =
"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n"
" debugger. It can be set to the callable of your debugger of\n"
" choice.\n"
-"PYTHON_CPU_COUNT: Overrides the return value of os.process_cpu_count(),\n"
-" os.cpu_count(), and multiprocessing.cpu_count() if set to\n"
-" a positive integer.\n"
-#ifdef Py_GIL_DISABLED
-"PYTHON_GIL : When set to 0, disables the GIL.\n"
-#endif
-"PYTHONDEVMODE : enable the development mode.\n"
-"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"
-"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"
-"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
-" the tables mapping extra location information (end line,\n"
-" start column offset and end column offset) to every\n"
-" instruction in code objects. This is useful when smaller\n"
-" code objects and pyc files are desired as well as\n"
-" suppressing the extra visual location indicators when the\n"
-" interpreter displays tracebacks.\n"
-"PYTHON_FROZEN_MODULES: if this variable is set, it determines whether or not\n"
-" frozen modules should be used. The default is \"on\" (or\n"
-" \"off\" if you are running a local build).\n"
"PYTHON_COLORS : if this variable is set to 1, the interpreter will colorize\n"
" various kinds of output. Setting it to 0 deactivates\n"
" this behavior.\n"
"PYTHON_HISTORY : the location of a .python_history file.\n"
"\n"
"These variables have equivalent command-line options (see --help for details):\n"
+"PYTHON_CPU_COUNT: Overrides the return value of os.process_cpu_count(),\n"
+" os.cpu_count(), and multiprocessing.cpu_count() if set to\n"
+" a positive integer. (-X cpu_count)\n"
"PYTHONDEBUG : enable parser debug mode (-d)\n"
+"PYTHONDEVMODE : enable the development mode (-X dev)\n"
"PYTHONDONTWRITEBYTECODE: don't write .pyc files (-B)\n"
+"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors (-X faulthandler)\n"
+"PYTHON_FROZEN_MODULES: if this variable is set, it determines whether or not\n"
+" frozen modules should be used. The default is \"on\" (or\n"
+" \"off\" if you are running a local build).\n"
+" (-X frozen_modules)\n"
+#ifdef Py_GIL_DISABLED
+"PYTHON_GIL : when set to 0, disables the GIL (-X gil)\n"
+#endif
"PYTHONINSPECT : inspect interactively after running script (-i)\n"
-"PYTHONINTMAXSTRDIGITS: limit max digit characters in an int value\n"
+"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
+" when converting from a string and when converting an int\n"
+" back to a str. A value of 0 disables the limit.\n"
+" Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
+" limited.\n"
" (-X int_max_str_digits=number)\n"
+"PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
+" the tables mapping extra location information (end line,\n"
+" start column offset and end column offset) to every\n"
+" instruction in code objects. This is useful when smaller\n"
+" code objects and pyc files are desired as well as\n"
+" suppressing the extra visual location indicators when the\n"
+" interpreter displays tracebacks. (-X no_debug_ranges)\n"
"PYTHONNOUSERSITE: disable user site directory (-s)\n"
"PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
#ifdef Py_DEBUG
-"PYTHON_PRESITE=pkg.mod: import this module before site.py is run\n"
+"PYTHON_PRESITE=pkg.mod: import this module before site.py is run (-X presite)\n"
#endif
+"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files\n"
+" (-X pycache_prefix)\n"
"PYTHONSAFEPATH : don't prepend a potentially unsafe path to sys.path.\n"
#ifdef Py_STATS
-"PYTHONSTATS : turns on statistics gathering\n"
+"PYTHONSTATS : turns on statistics gathering (-X pystats)\n"
#endif
"PYTHONUNBUFFERED: disable stdout/stderr buffering (-u)\n"
+"PYTHONUTF8 : if set to 1, enable the UTF-8 mode (-X utf8)\n"
"PYTHONVERBOSE : trace import statements (-v)\n"
+"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'\n"
+" (-X warn_default_encoding)\n"
"PYTHONWARNINGS=arg: warning control (-W arg)\n"
;