From 94de73ddc0c65fed50b53c1f06d762e525768f11 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Mon, 17 Nov 2008 22:02:19 -0700
Subject: [PATCH] cli: add --verbose to 'tahoe manifest', to show the raw JSON
 data

---
 src/allmydata/scripts/cli.py            | 3 +++
 src/allmydata/scripts/tahoe_manifest.py | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py
index ee3395b1..e9f80771 100644
--- a/src/allmydata/scripts/cli.py
+++ b/src/allmydata/scripts/cli.py
@@ -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
 
diff --git a/src/allmydata/scripts/tahoe_manifest.py b/src/allmydata/scripts/tahoe_manifest.py
index 7772a80d..378ad369 100644
--- a/src/allmydata/scripts/tahoe_manifest.py
+++ b/src/allmydata/scripts/tahoe_manifest.py
@@ -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
 
-- 
2.45.2