]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/scripts/create_node.py
bin/tahoe: clean up global-vs-subcommand arguments like --node-directory
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / scripts / create_node.py
index e204bafa2858df7ad2a66629f6a106f31fcd45df..893bf08c2b0ec62f3946a398dda7ce6d6747bee4 100644 (file)
@@ -1,11 +1,11 @@
 
 import os, sys
-from allmydata.scripts.common import BasedirMixin, BaseOptions
+from allmydata.scripts.common import BasedirOptions
 from allmydata.util.assertutil import precondition
 from allmydata.util.encodingutil import listdir_unicode, argv_to_unicode, quote_output
 import allmydata
 
-class CreateClientOptions(BasedirMixin, BaseOptions):
+class CreateClientOptions(BasedirOptions):
     optParameters = [
         # we provide 'create-node'-time options for the most common
         # configuration knobs. The rest can be controlled by editing
@@ -16,17 +16,25 @@ class CreateClientOptions(BasedirMixin, BaseOptions):
          "Specify which TCP port to run the HTTP interface on. Use 'none' to disable."),
         ]
 
+    def getSynopsis(self):
+        return "Usage:  %s create-client [options] [NODEDIR]" % (self.command_name,)
+
+
 class CreateNodeOptions(CreateClientOptions):
     optFlags = [
         ("no-storage", None, "Do not offer storage service to other nodes."),
         ]
 
-class CreateIntroducerOptions(BasedirMixin, BaseOptions):
+    def getSynopsis(self):
+        return "Usage:  %s create-node [options] [NODEDIR]" % (self.command_name,)
+
+
+class CreateIntroducerOptions(BasedirOptions):
     default_nodedir = None
 
-    optParameters = [
-        ["node-directory", "d", None, "Specify which directory the introducer should be created in. [no default]"],
-    ]
+    def getSynopsis(self):
+        return "Usage:  %s create-introducer [options] NODEDIR" % (self.command_name,)
+
 
 client_tac = """
 # -*- python -*-
@@ -140,6 +148,14 @@ def create_node(config, out=sys.stdout, err=sys.stderr):
     c.write("enabled = false\n")
     c.write("\n")
 
+    c.write("[drop_upload]\n")
+    c.write("# Shall this node automatically upload files created or modified in a local directory?\n")
+    c.write("enabled = false\n")
+    c.write("# To specify the target of uploads, a mutable directory writecap URI must be placed\n"
+            "# in 'private/drop_upload_dircap'.\n")
+    c.write("local.directory = ~/drop_upload\n")
+    c.write("\n")
+
     c.close()
 
     from allmydata.util import fileutil