@@ -49,7 +49,8 @@ Options (and corresponding environment variables):\n\
49
49
.pyc extension; also PYTHONOPTIMIZE=x\n\
50
50
-OO : do -O changes and also discard docstrings; add .opt-2 before\n\
51
51
.pyc extension\n\
52
- -P : don't prepend a potentially unsafe path to sys.path; also PYTHONSAFEPATH\n\
52
+ -P : don't prepend a potentially unsafe path to sys.path; also\n\
53
+ PYTHONSAFEPATH\n\
53
54
-q : don't print version and copyright messages on interactive startup\n\
54
55
-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
55
56
-S : don't imply 'import site' on initialization\n\
@@ -65,9 +66,10 @@ Options (and corresponding environment variables):\n\
65
66
-X opt : set implementation-specific option\n\
66
67
--check-hash-based-pycs always|default|never:\n\
67
68
control how Python invalidates hash-based .pyc files\n\
68
- --help-env : print help about Python environment variables and exit\n\
69
- --help-xoptions : print help about implementation-specific -X options and exit\n\
70
- --help-all : print complete help information and exit\n\
69
+ --help-env: print help about Python environment variables and exit\n\
70
+ --help-xoptions: print help about implementation-specific -X options and exit\n\
71
+ --help-all: print complete help information and exit\n\
72
+ \n\
71
73
Arguments:\n\
72
74
file : program read from script file\n\
73
75
- : program read from stdin (default; interactive mode if a tty)\n\
@@ -76,117 +78,114 @@ arg ...: arguments passed to program in sys.argv[1:]\n\
76
78
77
79
static const char usage_xoptions [] = "\
78
80
The following implementation-specific options are available:\n\
79
- \n\
80
81
-X faulthandler: enable faulthandler\n\
81
- \n\
82
82
-X showrefcount: output the total reference count and number of used\n\
83
- memory blocks when the program finishes or after each statement in the\n\
84
- interactive interpreter. This only works on debug builds\n\
85
- \n\
83
+ memory blocks when the program finishes or after each statement in\n\
84
+ the interactive interpreter. This only works on debug builds\n\
86
85
-X tracemalloc: start tracing Python memory allocations using the\n\
87
- tracemalloc module. By default, only the most recent frame is stored in a\n\
88
- traceback of a trace. Use -X tracemalloc=NFRAME to start tracing with a\n\
89
- traceback limit of NFRAME frames\n\
90
- \n\
91
- -X importtime: show how long each import takes. It shows module name,\n\
92
- cumulative time (including nested imports) and self time (excluding\n\
93
- nested imports). Note that its output may be broken in multi-threaded\n\
94
- application. Typical usage is python3 -X importtime -c 'import asyncio'\n\
95
- \n\
96
- -X dev: enable CPython's \"development mode\", introducing additional runtime\n\
97
- checks which are too expensive to be enabled by default. Effect of the\n\
98
- developer mode:\n\
99
- * Add default warning filter, as -W default\n\
100
- * Install debug hooks on memory allocators: see the PyMem_SetupDebugHooks()\n\
101
- C function\n\
102
- * Enable the faulthandler module to dump the Python traceback on a crash\n\
103
- * Enable asyncio debug mode\n\
104
- * Set the dev_mode attribute of sys.flags to True\n\
105
- * io.IOBase destructor logs close() exceptions\n\
106
- \n\
107
- -X utf8: enable UTF-8 mode for operating system interfaces, overriding the default\n\
108
- locale-aware mode. -X utf8=0 explicitly disables UTF-8 mode (even when it would\n\
109
- otherwise activate automatically)\n\
110
- \n\
111
- -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the\n\
112
- given directory instead of to the code tree\n\
113
- \n\
86
+ tracemalloc module. By default, only the most recent frame is stored\n\
87
+ in a traceback of a trace. Use -X tracemalloc=NFRAME to start\n\
88
+ tracing with a traceback limit of NFRAME frames\n\
89
+ -X importtime: show how long each import takes. It shows module name,\n\
90
+ cumulative time (including nested imports) and self time (excluding\n\
91
+ nested imports). Note that its output may be broken in\n\
92
+ multi-threaded application.\n\
93
+ Typical usage is python3 -X importtime -c 'import asyncio'\n\
94
+ -X dev : enable CPython's \"development mode\", introducing additional runtime\n\
95
+ checks which are too expensive to be enabled by default. Effect of\n\
96
+ the developer mode:\n\
97
+ * Add default warning filter, as -W default\n\
98
+ * Install debug hooks on memory allocators: see the\n\
99
+ PyMem_SetupDebugHooks() C function\n\
100
+ * Enable the faulthandler module to dump the Python traceback on\n\
101
+ a crash\n\
102
+ * Enable asyncio debug mode\n\
103
+ * Set the dev_mode attribute of sys.flags to True\n\
104
+ * io.IOBase destructor logs close() exceptions\n\
105
+ -X utf8: enable UTF-8 mode for operating system interfaces, overriding the\n\
106
+ default locale-aware mode. -X utf8=0 explicitly disables UTF-8 mode\n\
107
+ (even when it would otherwise activate automatically)\n\
108
+ -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted\n\
109
+ at the given directory instead of to the code tree\n\
114
110
-X warn_default_encoding: enable opt-in EncodingWarning for 'encoding=None'\n\
115
- \n\
116
- -X no_debug_ranges: disable the inclusion of the tables mapping extra location \n\
117
- information (end line, start column offset and end column offset) to every \n\
118
- instruction in code objects. This is useful when smaller code objects and pyc \n\
119
- files are desired as well as suppressing the extra visual location indicators \n\
120
- when the interpreter displays tracebacks.\n\
121
- \n\
122
- -X perf: activate support for the Linux \"perf\" profiler by activating the \"perf\"\n\
123
- trampoline. When this option is activated, the Linux \"perf\" profiler will be \n\
124
- able to report Python calls. This option is only available on some platforms and will \n\
125
- do nothing if is not supported on the current system. The default value is \"off\".\n\
126
- \n\
111
+ -X no_debug_ranges: disable the inclusion of the tables mapping extra location\n\
112
+ information (end line, start column offset and end column offset) to\n\
113
+ every instruction in code objects. This is useful when smaller code\n\
114
+ objects and pyc files are desired as well as suppressing the extra\n\
115
+ visual location indicators when the interpreter displays tracebacks.\n\
116
+ -X perf: activate support for the Linux \"perf\" profiler by activating the\n\
117
+ \"perf\" trampoline. When this option is activated, the Linux \"perf\"\n\
118
+ profiler will be able to report Python calls. This option is only\n\
119
+ available on some platforms and will do nothing if is not supported\n\
120
+ on the current system. The default value is \"off\".\n\
127
121
-X frozen_modules=[on|off]: whether or not frozen modules should be used.\n\
128
- The default is \"on\" (or \"off\" if you are running a local build).\n\
129
- \n\
122
+ The default is \"on\" (or \"off\" if you are running a local build).\n\
130
123
-X int_max_str_digits=number: limit the size of int<->str conversions.\n\
131
- This helps avoid denial of service attacks when parsing untrusted data. \n\
132
- The default is sys.int_info.default_max_str_digits. 0 disables."
133
-
124
+ This helps avoid denial of service attacks when parsing untrusted\n\
125
+ data. The default is sys.int_info.default_max_str_digits.\n\
126
+ 0 disables.\n\
134
127
#ifdef Py_STATS
135
128
" \n \
136
- \n\
137
129
- X pystats : Enable pystats collection at startup ."
138
130
#endif
139
131
;
140
132
141
133
/* Envvars that don't have equivalent command-line options are listed first */
142
134
static const char usage_envvars [] =
143
135
"Environment variables that change behavior:\n"
144
- "PYTHONSTARTUP: file executed on interactive startup (no default)\n"
145
- "PYTHONPATH : '%lc'-separated list of directories prefixed to the\n"
146
- " default module search path. The result is sys.path.\n"
147
- "PYTHONHOME : alternate <prefix> directory (or <prefix>%lc<exec_prefix>).\n"
148
- " The default module search path uses %s.\n"
149
- "PYTHONPLATLIBDIR : override sys.platlibdir.\n"
150
- "PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
151
- "PYTHONUTF8: if set to 1, enable the UTF-8 mode.\n"
136
+ "PYTHONSTARTUP : file executed on interactive startup (no default)\n"
137
+ "PYTHONPATH : '%lc'-separated list of directories prefixed to the\n"
138
+ " default module search path. The result is sys.path.\n"
139
+ "PYTHONHOME : alternate <prefix> directory (or <prefix>%lc<exec_prefix>).\n"
140
+ " The default module search path uses %s.\n"
141
+ "PYTHONPLATLIBDIR: override sys.platlibdir.\n"
142
+ "PYTHONCASEOK : ignore case in 'import' statements (Windows).\n"
143
+ "PYTHONUTF8 : if set to 1, enable the UTF-8 mode.\n"
152
144
"PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.\n"
153
145
"PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.\n"
154
- "PYTHONHASHSEED: if this variable is set to 'random', a random value is used\n"
155
- " to seed the hashes of str and bytes objects. It can also be set to an \n"
156
- " integer in the range [0,4294967295] to get hash values with a \n"
157
- " predictable seed.\n"
146
+ "PYTHONHASHSEED : if this variable is set to 'random', a random value is used\n"
147
+ " to seed the hashes of str and bytes objects. It can also be\n"
148
+ " set to an integer in the range [0,4294967295] to get hash\n"
149
+ " values with a predictable seed.\n"
158
150
"PYTHONINTMAXSTRDIGITS: limits the maximum digit characters in an int value\n"
159
- " when converting from a string and when converting an int back to a str.\n"
160
- " A value of 0 disables the limit. Conversions to or from bases 2, 4, 8,\n"
161
- " 16, and 32 are never limited.\n"
162
- "PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n"
163
- " on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n"
164
- " hooks.\n"
151
+ " when converting from a string and when converting an int\n"
152
+ " back to a str. A value of 0 disables the limit.\n"
153
+ " Conversions to or from bases 2, 4, 8, 16, and 32 are never\n"
154
+ " limited.\n"
155
+ "PYTHONMALLOC : set the Python memory allocators and/or install debug hooks\n"
156
+ " on Python memory allocators. Use PYTHONMALLOC=debug to\n"
157
+ " install debug hooks.\n"
165
158
"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n"
166
- " coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n"
167
- " locale coercion and locale compatibility warnings on stderr.\n"
159
+ " coercion behavior. Use PYTHONCOERCECLOCALE=warn to request\n"
160
+ " display of locale coercion and locale compatibility warnings\n"
161
+ " on stderr.\n"
168
162
"PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n"
169
- " debugger. It can be set to the callable of your debugger of choice.\n"
170
- "PYTHONDEVMODE: enable the development mode.\n"
163
+ " debugger. It can be set to the callable of your debugger of\n"
164
+ " choice.\n"
165
+ "PYTHONDEVMODE : enable the development mode.\n"
171
166
"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"
172
167
"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"
173
- "PYTHONNODEBUGRANGES: If this variable is set, it disables the inclusion of the \n"
174
- " tables mapping extra location information (end line, start column offset \n"
175
- " and end column offset) to every instruction in code objects. This is useful \n"
176
- " when smaller code objects and pyc files are desired as well as suppressing the \n"
177
- " extra visual location indicators when the interpreter displays tracebacks.\n"
178
- "These variables have equivalent command-line parameters (see --help for details):\n"
179
- "PYTHONDEBUG : enable parser debug mode (-d)\n"
180
- "PYTHONDONTWRITEBYTECODE : don't write .pyc files (-B)\n"
181
- "PYTHONINSPECT : inspect interactively after running script (-i)\n"
182
- "PYTHONINTMAXSTRDIGITS : limit max digit characters in an int value\n"
183
- " (-X int_max_str_digits=number)\n"
184
- "PYTHONNOUSERSITE : disable user site directory (-s)\n"
185
- "PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
186
- "PYTHONSAFEPATH : don't prepend a potentially unsafe path to sys.path (-P)\n"
187
- "PYTHONUNBUFFERED : disable stdout/stderr buffering (-u)\n"
188
- "PYTHONVERBOSE : trace import statements (-v)\n"
189
- "PYTHONWARNINGS=arg : warning control (-W arg)\n" ;
168
+ "PYTHONNODEBUGRANGES: if this variable is set, it disables the inclusion of\n"
169
+ " the tables mapping extra location information (end line,\n"
170
+ " start column offset and end column offset) to every\n"
171
+ " instruction in code objects. This is useful when smaller\n"
172
+ " code objects and pyc files are desired as well as\n"
173
+ " suppressing the extra visual location indicators when the\n"
174
+ " interpreter displays tracebacks.\n"
175
+ "\n"
176
+ "These variables have equivalent command-line options (see --help for details):\n"
177
+ "PYTHONDEBUG : enable parser debug mode (-d)\n"
178
+ "PYTHONDONTWRITEBYTECODE: don't write .pyc files (-B)\n"
179
+ "PYTHONINSPECT : inspect interactively after running script (-i)\n"
180
+ "PYTHONINTMAXSTRDIGITS: limit max digit characters in an int value\n"
181
+ " (-X int_max_str_digits=number)\n"
182
+ "PYTHONNOUSERSITE: disable user site directory (-s)\n"
183
+ "PYTHONOPTIMIZE : enable level 1 optimizations (-O)\n"
184
+ "PYTHONSAFEPATH : don't prepend a potentially unsafe path to sys.path.\n"
185
+ "PYTHONUNBUFFERED: disable stdout/stderr buffering (-u)\n"
186
+ "PYTHONVERBOSE : trace import statements (-v)\n"
187
+ "PYTHONWARNINGS=arg: warning control (-W arg)\n"
188
+ ;
190
189
191
190
#if defined(MS_WINDOWS )
192
191
# define PYTHONHOMEHELP "<prefix>\\python{major}{minor}"
@@ -2370,9 +2369,9 @@ static void
2370
2369
config_complete_usage (const wchar_t * program )
2371
2370
{
2372
2371
config_usage (0 , program );
2373
- puts ( "\n" );
2372
+ putchar ( '\n' );
2374
2373
config_envvars_usage ();
2375
- puts ( "\n" );
2374
+ putchar ( '\n' );
2376
2375
config_xoptions_usage ();
2377
2376
}
2378
2377
0 commit comments