diff options
author | Guido van Rossum <guido@python.org> | 1992-03-27 17:21:30 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-03-27 17:21:30 (GMT) |
commit | e3d7045e478619931aec5a0dca55bffcff22354f (patch) | |
tree | 1a8e30c78748477f0b4865e6590c32398565ed6f /Python | |
parent | 4cd8b5cad8236baebaccc62e57c3f7828d49a667 (diff) | |
download | cpython-e3d7045e478619931aec5a0dca55bffcff22354f.zip cpython-e3d7045e478619931aec5a0dca55bffcff22354f.tar.gz cpython-e3d7045e478619931aec5a0dca55bffcff22354f.tar.bz2 |
Add -v option (verbose) and get rid of finaloutput() function (unused)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pythonmain.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Python/pythonmain.c b/Python/pythonmain.c index b00a270..3a37544 100644 --- a/Python/pythonmain.c +++ b/Python/pythonmain.c @@ -42,6 +42,7 @@ extern char *getpythonpath(); extern grammar gram; /* From graminit.c */ int debugging; /* Needed by parser.c */ +int verbose; /* Needed by import.c */ /* Interface to getopt(): */ extern int optind; @@ -60,7 +61,7 @@ main(argc, argv) initargs(&argc, &argv); /* Defined in config*.c */ - while ((c = getopt(argc, argv, "c:d")) != EOF) { + while ((c = getopt(argc, argv, "c:dv")) != EOF) { if (c == 'c') { /* -c is the last option; following arguments that look like options are left for the @@ -78,6 +79,10 @@ main(argc, argv) debugging++; break; + case 'v': + verbose++; + break; + /* This space reserved for other options */ default: @@ -157,7 +162,7 @@ run(fp, filename) { if (filename == NULL) filename = "???"; - if (isatty(fileno(fp))) + if (isatty((int)fileno(fp))) return run_tty_loop(fp, filename); else return run_script(fp, filename); @@ -457,16 +462,7 @@ goaway(sts) /*NOTREACHED*/ } -static -finaloutput() -{ #ifdef TRACE_REFS - if (!askyesno("Print left references?")) - return; - printrefs(stderr); -#endif /* TRACE_REFS */ -} - /* Ask a yes/no question */ static int @@ -480,6 +476,7 @@ askyesno(prompt) return 0; return buf[0] == 'y' || buf[0] == 'Y'; } +#endif #ifdef applec /* MPW (also usable for Think C 3.0) */ |