]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/scripts/tahoe_webopen.py
cli: webopen: when called with no arguments, open the Welcome page
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / scripts / tahoe_webopen.py
index 6470bb4051daa633ccb236d4cb9b40f972777a97..b4e13c1482a89e3f713f21f7cbd780b1a183ea39 100644 (file)
@@ -7,12 +7,15 @@ def webopen(options, opener=None):
     if not nodeurl.endswith("/"):
         nodeurl += "/"
     where = options.where
-    rootcap, path = get_alias(options.aliases, where, DEFAULT_ALIAS)
-    if path == '/':
-        path = ''
-    url = nodeurl + "uri/%s" % urllib.quote(rootcap)
-    if path:
-        url += "/" + escape_path(path)
+    if where:
+        rootcap, path = get_alias(options.aliases, where, DEFAULT_ALIAS)
+        if path == '/':
+            path = ''
+        url = nodeurl + "uri/%s" % urllib.quote(rootcap)
+        if path:
+            url += "/" + escape_path(path)
+    else:
+        url = nodeurl
     if not opener:
         import webbrowser
         opener = webbrowser.open