mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 15:53:48 +00:00
scripts: rearrange Options, make --version behave the same for all commands
This commit is contained in:
@ -3,9 +3,10 @@ import sys
|
||||
from cStringIO import StringIO
|
||||
from twisted.python import usage
|
||||
|
||||
from allmydata.scripts.common import BaseOptions
|
||||
import debug, create_node, startstop_node, cli
|
||||
|
||||
class Options(cli.OptionsMixin):
|
||||
class Options(BaseOptions, usage.Options):
|
||||
synopsis = "Usage: allmydata <command> [command options]"
|
||||
|
||||
subCommands = []
|
||||
@ -14,15 +15,6 @@ class Options(cli.OptionsMixin):
|
||||
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")
|
||||
|
Reference in New Issue
Block a user