Commit 57bca1f0 authored by Jeremy Hylton's avatar Jeremy Hylton

Add -v option to control whether tracebacks are printed.

parent e4aaa094
...@@ -32,6 +32,8 @@ import cStringIO ...@@ -32,6 +32,8 @@ import cStringIO
import traceback import traceback
import types import types
VERBOSE = 0
def get_refs(pickle): def get_refs(pickle):
refs = [] refs = []
f = cStringIO.StringIO(pickle) f = cStringIO.StringIO(pickle)
...@@ -67,6 +69,7 @@ def main(path): ...@@ -67,6 +69,7 @@ def main(path):
data, serial = fs.load(oid, "") data, serial = fs.load(oid, "")
except: except:
print "oid %s failed to load" % hex(u64(oid)) print "oid %s failed to load" % hex(u64(oid))
if VERBOSE:
traceback.print_exc() traceback.print_exc()
noload[oid] = 1 noload[oid] = 1
...@@ -93,4 +96,12 @@ def main(path): ...@@ -93,4 +96,12 @@ def main(path):
if __name__ == "__main__": if __name__ == "__main__":
import sys import sys
main(sys.argv[1]) import getopt
opts, args = getopt.getopt(sys.argv[1:], "v")
for k, v in opts:
if k == "-v":
VERBOSE += 1
path, = args
main(path)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment