cli: add --verbose to 'tahoe manifest', to show the raw JSON data

This commit is contained in:
Brian Warner 2008-11-17 22:02:19 -07:00
parent 0a819e2912
commit 94de73ddc0
2 changed files with 8 additions and 1 deletions

View File

@ -210,6 +210,9 @@ class ManifestOptions(VDriveOptions):
longdesc = """Print a list of all files/directories reachable from the given starting point."""
class StatsOptions(VDriveOptions):
optFlags = [
("verbose", "v", "Display raw JSON data instead of parsed"),
]
def parseArgs(self, where=''):
self.where = where

View File

@ -63,9 +63,13 @@ class SlowOperationRunner:
if resp.status != 200:
print >>stderr, "ERROR", resp.status, resp.reason, resp.read()
return True
data = simplejson.loads(resp.read())
jdata = resp.read()
data = simplejson.loads(jdata)
if not data["finished"]:
return False
if self.options.get("verbose"):
print jdata
return True
self.write_results(data)
return True