mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 18:06:46 +00:00
runner.py: allow all directory-using commands (create/start/stop) to accept argv[-1] as well as --basedir
This commit is contained in:
parent
e5fdf0daca
commit
daa4c32381
@ -48,6 +48,12 @@ class BasedirMixin:
|
|||||||
raise usage.UsageError("<basedir> parameter is required")
|
raise usage.UsageError("<basedir> parameter is required")
|
||||||
self['basedir'] = os.path.abspath(os.path.expanduser(self['basedir']))
|
self['basedir'] = os.path.abspath(os.path.expanduser(self['basedir']))
|
||||||
|
|
||||||
|
def parseArgs(self, *args):
|
||||||
|
if len(args) > 0:
|
||||||
|
self['basedir'] = args[0]
|
||||||
|
if len(args) > 1:
|
||||||
|
raise usage.UsageError("I wasn't expecting so many arguments")
|
||||||
|
|
||||||
class StartOptions(BasedirMixin, usage.Options):
|
class StartOptions(BasedirMixin, usage.Options):
|
||||||
optParameters = [
|
optParameters = [
|
||||||
["basedir", "C", ".", "which directory to start the node in"],
|
["basedir", "C", ".", "which directory to start the node in"],
|
||||||
@ -85,12 +91,6 @@ class CreateIntroducerOptions(BasedirMixin, usage.Options):
|
|||||||
["quiet", "q", "operate silently"],
|
["quiet", "q", "operate silently"],
|
||||||
]
|
]
|
||||||
|
|
||||||
def parseArgs(self, *args):
|
|
||||||
if len(args) > 0:
|
|
||||||
self['basedir'] = args[0]
|
|
||||||
if len(args) > 1:
|
|
||||||
raise usage.UsageError("I wasn't expecting so many arguments")
|
|
||||||
|
|
||||||
client_tac = """
|
client_tac = """
|
||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user