]> granicus.if.org Git - python/commitdiff
Added -X option to suppress default import of site.py. Also split the
authorGuido van Rossum <guido@python.org>
Fri, 29 Aug 1997 22:34:47 +0000 (22:34 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 29 Aug 1997 22:34:47 +0000 (22:34 +0000)
usage message in *three* parts under 510 bytes, for low-end ANSI
compatibility.

Modules/main.c

index cc18dfae77dbd15320fd12145c92c873fe05fc3d..b882ff9e00bb05b1d7e4a3f8a854d9f35ee2f1ea 100644 (file)
@@ -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*/