From 9641a6df227cb3be5fed4998f453afbc046fb669 Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Mon, 9 Jul 2007 18:20:02 -0700
Subject: [PATCH] tahoe-get.py: accept vdrive and server options (using
 optparse)

---
 src/allmydata/scripts/tahoe-get.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/allmydata/scripts/tahoe-get.py b/src/allmydata/scripts/tahoe-get.py
index 4a034d5a..5c92ef0e 100644
--- a/src/allmydata/scripts/tahoe-get.py
+++ b/src/allmydata/scripts/tahoe-get.py
@@ -1,15 +1,24 @@
 #!/usr/bin/env python
 
-import sys, urllib
+import optparse, sys, urllib
 
 def GET(url):
     f = urllib.urlopen(url)
     sys.stdout.write(f.read())
 
-vfname = sys.argv[1]
+parser = optparse.OptionParser()
+parser.add_option("-d", "--vdrive", dest="vdrive", default="global")
+parser.add_option("-s", "--server", dest="server", default="http://tahoebs1.allmydata.com:8011")
+
+(options, args) = parser.parse_args()
+
+vfname = args[0]
 
 base = "http://tahoebs1.allmydata.com:8011/"
-base += "vdrive/global/"
+base += "vdrive/"
+base += options.vdrive
+base += "/"
+
 url = base + vfname
 
 GET(url)
-- 
2.45.2