self.cap = cap
def getSynopsis(self):
- return "%s add-alias ALIAS[:] DIRCAP" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s add-alias ALIAS[:] DIRCAP" % (os.path.basename(sys.argv[0]),)
longdesc = """Add a new alias for an existing directory."""
self.alias = self.alias[:-1]
def getSynopsis(self):
- return "%s create-alias ALIAS[:]" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s create-alias ALIAS[:]" % (os.path.basename(sys.argv[0]),)
longdesc = """Create a new directory and add an alias for it."""
self.to_file = None
def getSynopsis(self):
- return "%s get REMOTE_FILE LOCAL_FILE" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s get REMOTE_FILE LOCAL_FILE" % (os.path.basename(sys.argv[0]),)
longdesc = """
Retrieve a file from the grid and write it to the local filesystem. If
self.from_file = None
def getSynopsis(self):
- return "%s put LOCAL_FILE REMOTE_FILE" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s put LOCAL_FILE REMOTE_FILE" % (os.path.basename(sys.argv[0]),)
longdesc = """
Put a file into the grid, copying its contents from the local filesystem.
self.where = argv_to_unicode(where)
def getSynopsis(self):
- return "%s rm REMOTE_FILE" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s rm REMOTE_FILE" % (os.path.basename(sys.argv[0]),)
class UnlinkOptions(RmOptions):
def getSynopsis(self):
- return "%s unlink REMOTE_FILE" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s unlink REMOTE_FILE" % (os.path.basename(sys.argv[0]),)
class MvOptions(VDriveOptions):
def parseArgs(self, frompath, topath):
self.to_file = argv_to_unicode(topath)
def getSynopsis(self):
- return "%s mv FROM TO" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s mv FROM TO" % (os.path.basename(sys.argv[0]),)
longdesc = """
Use 'tahoe mv' to move files that are already on the grid elsewhere on
the grid, e.g., 'tahoe mv alias:some_file alias:new_file'.
self.to_file = argv_to_unicode(topath)
def getSynopsis(self):
- return "%s ln FROM_LINK TO_LINK" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s ln FROM_LINK TO_LINK" % (os.path.basename(sys.argv[0]),)
longdesc = """
Use 'tahoe ln' to duplicate a link (directory entry) already on the grid
self.to_dir = argv_to_unicode(topath)
def getSynopsis(Self):
- return "%s backup FROM ALIAS:TO" % os.path.basename(sys.argv[0])
+ return "Usage: %s backup FROM ALIAS:TO" % os.path.basename(sys.argv[0])
def opt_exclude(self, pattern):
"""Ignore files matching a glob pattern. You may give multiple
self.where = argv_to_unicode(where)
def getSynopsis(self):
- return "%s webopen [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s webopen [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
longdesc = """Open a web browser to the contents of some file or
directory on the grid. When run without arguments, open the Welcome
self.where = argv_to_unicode(where)
def getSynopsis(self):
- return "%s manifest [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s manifest [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
longdesc = """Print a list of all files and directories reachable from
the given starting point."""
self.where = argv_to_unicode(where)
def getSynopsis(self):
- return "%s stats [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s stats [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
longdesc = """Print statistics about of all files and directories
reachable from the given starting point."""
self.where = argv_to_unicode(where)
def getSynopsis(self):
- return "%s check [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s check [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
longdesc = """
Check a single file or directory: count how many shares are available and
self.where = argv_to_unicode(where)
def getSynopsis(self):
- return "%s deep-check [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
+ return "Usage: %s deep-check [ALIAS:PATH]" % (os.path.basename(sys.argv[0]),)
longdesc = """
Check all files and directories reachable from the given starting point
from allmydata.util.assertutil import precondition
from allmydata.util.encodingutil import listdir_unicode, quote_output
+
class StartOptions(BasedirMixin, BaseOptions):
optFlags = [
["profile", "p", "Run under the Python profiler, putting results in 'profiling_results.prof'."],
["syslog", None, "Tell the node to log to syslog, not a file."],
]
+ def getSynopsis(self):
+ return "Usage: %s start [options] [NODEDIR]" % (os.path.basename(sys.argv[0]),)
+
+
class StopOptions(BasedirMixin, BaseOptions):
- pass
+ def getSynopsis(self):
+ return "Usage: %s stop [options] [NODEDIR]" % (os.path.basename(sys.argv[0]),)
+
class RestartOptions(BasedirMixin, BaseOptions):
optFlags = [
["syslog", None, "Tell the node to log to syslog, not a file."],
]
+ def getSynopsis(self):
+ return "Usage: %s restart [options] [NODEDIR]" % (os.path.basename(sys.argv[0]),)
+
+
class RunOptions(BasedirMixin, BaseOptions):
default_nodedir = u"."
["node-directory", "d", None, "Specify the directory of the node to be run. [default, for 'tahoe run' only: current directory]"],
]
+ def getSynopsis(self):
+ return "Usage: %s run [options] [NODEDIR]" % (os.path.basename(sys.argv[0]),)
+
+
def start(opts, out=sys.stdout, err=sys.stderr):
basedir = opts['basedir']
print >>out, "STARTING", quote_output(basedir)