From: mike Date: Tue, 26 Jun 2007 16:43:41 +0000 (+0000) Subject: Add new -d option to test-harness to turn on debugging. X-Git-Tag: v1.5~124 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=6fa449a6e0c675e2ceeaac0433b07a33f2876e55;p=cql-java-moved-to-github.git Add new -d option to test-harness to turn on debugging. --- diff --git a/src/org/z3950/zing/cql/CQLParser.java b/src/org/z3950/zing/cql/CQLParser.java index da2af02..892c8da 100644 --- a/src/org/z3950/zing/cql/CQLParser.java +++ b/src/org/z3950/zing/cql/CQLParser.java @@ -1,4 +1,4 @@ -// $Id: CQLParser.java,v 1.24 2007-06-06 12:22:01 mike Exp $ +// $Id: CQLParser.java,v 1.25 2007-06-26 16:43:41 mike Exp $ package org.z3950.zing.cql; import java.io.IOException; @@ -12,7 +12,7 @@ import java.io.FileNotFoundException; /** * Compiles CQL strings into parse trees of CQLNode subtypes. * - * @version $Id: CQLParser.java,v 1.24 2007-06-06 12:22:01 mike Exp $ + * @version $Id: CQLParser.java,v 1.25 2007-06-26 16:43:41 mike Exp $ * @see http://zing.z3950.org/cql/index.html */ @@ -373,6 +373,11 @@ public class CQLParser { argv.add(args[i]); } + if (argv.size() > 0 && argv.get(0).equals("-d")) { + DEBUG = true; + argv.remove(0); + } + if (argv.size() > 0 && argv.get(0).equals("-c")) { mode = 'c'; argv.remove(0); @@ -384,8 +389,7 @@ public class CQLParser { } if (argv.size() > 1) { - System.err.println( - "Usage: CQLParser [-c] [-p []"); + System.err.println("Usage: CQLParser [-d] [-c] [-p []"); System.err.println("If unspecified, query is read from stdin"); System.exit(1); }