Update of /cvsroot/jython/jython/org/python/util
In directory usw-pr-cvs1:/tmp/cvs-serv19459
Modified Files:
jython.java
Log Message:
Support the -Q option (pep-238).
Index: jython.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/util/jython.java,v
retrieving revision 2.24
retrieving revision 2.25
diff -C2 -d -r2.24 -r2.25
*** jython.java 2001/12/07 13:48:56 2.24
--- jython.java 2002/01/13 18:21:24 2.25
***************
*** 22,25 ****
--- 22,27 ----
"lineno)\n"+
"-E codec : Use a different codec the reading from the console.\n"+
+ "-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, " +
+ "-Qnew\n"+
"file : program read from script file\n"+
"- : program read from stdin (default; interactive mode if a "+
***************
*** 145,148 ****
--- 147,163 ----
}
+ if (opts.division != null) {
+ if ("old".equals(opts.division))
+ Options.divisionWarning = 0;
+ else if ("warn".equals(opts.division))
+ Options.divisionWarning = 1;
+ else if ("warnall".equals(opts.division))
+ Options.divisionWarning = 2;
+ else if ("new".equals(opts.division)) {
+ Options.Qnew = true;
+ interp.cflags.division = true;
+ }
+ }
+
if (opts.command != null) {
try {
***************
*** 219,222 ****
--- 234,238 ----
public java.util.Vector warnoptions = new java.util.Vector();
public String encoding;
+ public String division;
public CommandLineOptions() {
***************
*** 302,305 ****
--- 318,327 ----
}
setProperty(key, value);
+ }
+ else if (arg.startsWith("-Q")) {
+ if (arg.length() > 2)
+ division = arg.substring(2);
+ else
+ division = args[++index];
}
else {
|