From 08f445a56262cb13fbc527eb4c1981643ed5bbde Mon Sep 17 00:00:00 2001
From: robk-tahoe <robk-tahoe@allmydata.com>
Date: Wed, 9 Jan 2008 19:19:52 -0700
Subject: [PATCH] added a 'repl' command to tahoe.exe

this is probably not of very high utility in the unix case of bin/tahoe
but is useful when working with native builds, e.g. py2exe's tahoe.exe,
to examine and debug the runtime environment, linking problems etc.
---
 src/allmydata/scripts/cli.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py
index 0e063377..c8d01eff 100644
--- a/src/allmydata/scripts/cli.py
+++ b/src/allmydata/scripts/cli.py
@@ -120,6 +120,9 @@ class WebopenOptions(VDriveOptions):
 
     longdesc = """Opens a webbrowser to the contents of some portion of the virtual drive."""
 
+class ReplOptions(usage.Options):
+    pass
+
 subCommands = [
     ["ls", None, ListOptions, "List a directory"],
     ["get", None, GetOptions, "Retrieve a file from the virtual drive."],
@@ -127,6 +130,7 @@ subCommands = [
     ["rm", None, RmOptions, "Unlink a file or directory in the virtual drive."],
     ["mv", None, MvOptions, "Move a file within the virtual drive."],
     ["webopen", None, WebopenOptions, "Open a webbrowser to the root_dir"],
+    ["repl", None, ReplOptions, "Open a python interpreter"],
     ]
 
 def list(config, stdout, stderr):
@@ -209,6 +213,10 @@ def webopen(config, stdout, stderr):
     webbrowser.open(url)
     return 0
 
+def repl(config, stdout, stderr):
+    import code
+    return code.interact()
+
 dispatch = {
     "ls": list,
     "get": get,
@@ -216,5 +224,6 @@ dispatch = {
     "rm": rm,
     "mv": mv,
     "webopen": webopen,
+    "repl": repl,
     }
 
-- 
2.45.2