W3C home > Mailing lists > Public > public-cwm-bugs@w3.org > June 2005

delta verbose and granularity cmdline options broken

From: EspeonEefi <eefi@MIT.EDU>
Date: Mon, 13 Jun 2005 17:43:13 -0400
To: public-cwm-bugs@w3.org
Message-Id: <1118698993.6503.28.camel@localhost.localdomain>

The documentation for the verbose command line option does not match the
current state of the code. In addition, the handling of the granularity
option also seems a bit buggy. The following patch I think fixes both.
Note that I haven't actually constructed a test case for seeing the
effects of the granularity option. (Which of the tests makes different
output depending on granularity?) However, the intent (setting the
variable lumped) seems to work okay.

-- eefi


Index: delta.py
===================================================================
RCS file: /sources/public/2000/10/swap/delta.py,v
retrieving revision 1.5
diff -u -r1.5 delta.py
--- delta.py	17 Feb 2005 20:53:01 -0000	1.5
+++ delta.py	13 Jun 2005 19:23:48 -0000
@@ -8,7 +8,7 @@
 --to=uri      	-t uri     file against which to check for differences
 --meta=uri      -m uri     file with metadata to be assumed (in addition to schemas)
 --help    	-h         print this help message
---verbose 	-v         verbose mode (two for extra)
+--verbose= 	-v 1       verbose mode (can be 0 to 10, 0 is default)
 --granularity=  -g 0       g=0 - lots of little diffs.
 			   g=1, fewer diffs (default)
 
@@ -482,7 +482,7 @@
     verbose = 0
     lumped = 1
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "hf:t:m:v:g",
+        opts, args = getopt.getopt(sys.argv[1:], "hf:t:m:v:g:",
 	    ["help", "from=", "to=", "meta=", "verbose=", "granularity="])
     except getopt.GetoptError:
         # print help information and exit:
@@ -496,8 +496,9 @@
         if o in ("-v", "--verbose"):
 	    try: verbose = int(a)
 	    except ValueError: verbose = 10
-        if o in ("-l", "--granularity"):
-	    lumped = int(a)
+        if o in ("-g", "--granularity"):
+	    try: lumped = int(a)
+	    except ValueError: lumped = 0
 	if o in ("-f", "--from"):
 	    testFiles.append(a)
 	if o in ("-t", "--to"):
Received on Monday, 13 June 2005 21:43:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:59 GMT