summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-29 22:34:47 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-29 22:34:47 (GMT)
commit7922bd7382c7e22ee9f711f6554718b824ac85a4 (patch)
tree8df6a9e10b6ace9c12994560bc88fc8e58e1aea8
parent3d90af967d27d705e79718204956b5c9c1100b96 (diff)
downloadcpython-7922bd7382c7e22ee9f711f6554718b824ac85a4.zip
cpython-7922bd7382c7e22ee9f711f6554718b824ac85a4.tar.gz
cpython-7922bd7382c7e22ee9f711f6554718b824ac85a4.tar.bz2
Added -X option to suppress default import of site.py. Also split the
usage message in *three* parts under 510 bytes, for low-end ANSI compatibility.
-rw-r--r--Modules/main.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/Modules/main.c b/Modules/main.c
index cc18dfa..b882ff9 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -53,7 +53,7 @@ static int orig_argc;
/* Short usage message (with %s for argv0) */
static char *usage_line =
-"usage: %s [-d] [-i] [-O] [-s] [-u] [-v] [-c cmd | file | -] [arg] ...\n";
+"usage: %s [-d] [-i] [-O] [-S] [-u] [-v] [-X] [-c cmd | file | -] [arg] ...\n";
/* Long usage message, split into parts < 512 bytes */
static char *usage_top = "\n\
@@ -62,15 +62,18 @@ Options and arguments (and corresponding environment variables):\n\
-i : inspect interactively after running script, (also PYTHONINSPECT=x)\n\
and force prompts, even if stdin does not appear to be a terminal.\n\
-O : optimize generated bytecode (a tad).\n\
+-S : don't imply 'import site' on initialization\n\
+";
+static char *usage_mid = "\
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\
--X : disable class based built-in exceptions\n\
-v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\
-";
-static char *usage_bot = "\
+-X : disable class based built-in exceptions\n\
-c cmd : program passed in as string (terminates option list)\n\
file : program read from script file\n\
- : program read from stdin (default; interactive mode if a tty)\n\
arg ...: arguments passed to program in sys.argv[1:]\n\
+";
+static char *usage_bot = "\
\n\
Other environment variables:\n\
PYTHONSTARTUP: file executed on interactive startup (no default)\n\
@@ -107,7 +110,7 @@ Py_Main(argc, argv)
unbuffered = 1;
Py_UseClassExceptionsFlag = 1;
- while ((c = getopt(argc, argv, "c:diOuvX")) != EOF) {
+ while ((c = getopt(argc, argv, "c:diOSuvX")) != EOF) {
if (c == 'c') {
/* -c is the last option; following arguments
that look like options are left for the
@@ -136,6 +139,10 @@ Py_Main(argc, argv)
Py_OptimizeFlag++;
break;
+ case 'S':
+ Py_NoSiteFlag++;
+ break;
+
case 'u':
unbuffered++;
break;
@@ -153,6 +160,7 @@ Py_Main(argc, argv)
default:
fprintf(stderr, usage_line, argv[0]);
fprintf(stderr, usage_top);
+ fprintf(stderr, usage_mid);
fprintf(stderr, usage_bot);
exit(2);
/*NOTREACHED*/