]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
runner.py: make 'allmydata-tahoe --version' emit version numbers of everything
authorBrian Warner <warner@allmydata.com>
Mon, 16 Jul 2007 21:58:36 +0000 (14:58 -0700)
committerBrian Warner <warner@allmydata.com>
Mon, 16 Jul 2007 21:58:36 +0000 (14:58 -0700)
src/allmydata/scripts/runner.py

index eacff4fcd50181e91734921cd5c26d0ee251f464..1b6af812d8f1d1349b7e0ee0e253b51839561639 100644 (file)
@@ -9,7 +9,8 @@ class Options(usage.Options):
     synopsis = "Usage:  allmydata <command> [command options]"
 
     optFlags = [
-        ["quiet", "q", "operate silently"],
+        ["quiet", "q", "Operate silently."],
+        ["version", "V", "Display version numbers and exit."],
         ]
 
     subCommands = []
@@ -18,6 +19,15 @@ class Options(usage.Options):
     subCommands += debug.subCommands
     subCommands += cli.subCommands
 
+    def opt_version(self):
+        from twisted import copyright
+        import allmydata, zfec, foolscap
+        print "Twisted version:", copyright.version
+        print "Foolscap version:", foolscap.__version__
+        print "zfec version:", zfec.__version__
+        print "allmydata version:", allmydata.__version__
+        sys.exit(0)
+
     def postOptions(self):
         if not hasattr(self, 'subOptions'):
             raise usage.UsageError("must specify a command")