@@ -40,7 +40,7 @@ static char **orig_argv;
4040static int orig_argc ;
4141
4242/* command line options */
43- #define BASE_OPTS "3c :dEhim:OQ:StuUvVW:xX?"
43+ #define BASE_OPTS "3Bc :dEhim:OQ:StuUvVW:xX?"
4444
4545#ifndef RISCOS
4646#define PROGRAM_OPTS BASE_OPTS
@@ -59,39 +59,42 @@ static char *usage_line =
5959/* Long usage message, split into parts < 512 bytes */
6060static char * usage_1 = "\
6161Options and arguments (and corresponding environment variables):\n\
62+ -B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n\
6263-c cmd : program passed in as string (terminates option list)\n\
6364-d : debug output from parser; also PYTHONDEBUG=x\n\
6465-E : ignore environment variables (such as PYTHONPATH)\n\
6566-h : print this help message and exit (also --help)\n\
6667-i : inspect interactively after running script; forces a prompt even\n\
67- if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\
6868" ;
6969static char * usage_2 = "\
70+ if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n\
7071-m mod : run library module as a script (terminates option list)\n\
7172-O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
7273-OO : remove doc-strings in addition to the -O optimizations\n\
7374-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\
7475-S : don't imply 'import site' on initialization\n\
7576-t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\
76- -u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x\n\
7777" ;
7878static char * usage_3 = "\
79+ -u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x\n\
7980 see man page for details on internal buffering relating to '-u'\n\
8081-v : verbose (trace import statements); also PYTHONVERBOSE=x\n\
8182 can be supplied multiple times to increase verbosity\n\
8283-V : print the Python version number and exit (also --version)\n\
8384-W arg : warning control; arg is action:message:category:module:lineno\n\
8485-x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\
86+ " ;
87+ static char * usage_4 = "\
8588-3 : warn about Python 3.x incompatibilities\n\
8689file : program read from script file\n\
8790- : program read from stdin (default; interactive mode if a tty)\n\
88- " ;
89- static char * usage_4 = "\
9091arg ...: arguments passed to program in sys.argv[1:]\n\n\
9192Other environment variables:\n\
9293PYTHONSTARTUP: file executed on interactive startup (no default)\n\
9394PYTHONPATH : '%c'-separated list of directories prefixed to the\n\
9495 default module search path. The result is sys.path.\n\
96+ " ;
97+ static char * usage_5 = "\
9598PYTHONHOME : alternate <prefix> directory (or <prefix>%c<exec_prefix>).\n\
9699 The default module search path uses %s.\n\
97100PYTHONCASEOK : ignore case in 'import' statements (Windows).\n\
@@ -110,7 +113,8 @@ usage(int exitcode, char* program)
110113 fprintf (f , usage_1 );
111114 fprintf (f , usage_2 );
112115 fprintf (f , usage_3 );
113- fprintf (f , usage_4 , DELIM , DELIM , PYTHONHOMEHELP );
116+ fprintf (f , usage_4 , DELIM );
117+ fprintf (f , usage_5 , DELIM , PYTHONHOMEHELP );
114118 }
115119#if defined(__VMS )
116120 if (exitcode == 0 ) {
@@ -337,6 +341,10 @@ Py_Main(int argc, char **argv)
337341 Py_OptimizeFlag ++ ;
338342 break ;
339343
344+ case 'B' :
345+ Py_DontWriteBytecodeFlag ++ ;
346+ break ;
347+
340348 case 'S' :
341349 Py_NoSiteFlag ++ ;
342350 break ;
0 commit comments