mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
runner: make most commands use ~/.tahoe by default (create-client, start/stop/restart, all CLI tools, but *not* create-introducer
This commit is contained in:
parent
a29ab33379
commit
7fd1964c6f
@ -40,7 +40,7 @@ class BasedirMixin:
|
||||
self.basedirs.extend(args)
|
||||
else:
|
||||
if len(args) == 0 and not self.basedirs:
|
||||
self.basedirs.append(".")
|
||||
self.basedirs.append(os.path.expanduser("~/.tahoe"))
|
||||
if len(args) > 0:
|
||||
self.basedirs.append(args[0])
|
||||
if len(args) > 1:
|
||||
@ -48,7 +48,7 @@ class BasedirMixin:
|
||||
|
||||
class NoDefaultBasedirMixin(BasedirMixin):
|
||||
def parseArgs(self, *args):
|
||||
# create-client won't default to --basedir=.
|
||||
# create-client won't default to --basedir=~/.tahoe
|
||||
self.basedirs = []
|
||||
if self['basedir']:
|
||||
self.basedirs.append(self['basedir'])
|
||||
|
@ -1,9 +1,9 @@
|
||||
|
||||
import os, sys
|
||||
from twisted.python import usage
|
||||
from allmydata.scripts.common import NoDefaultBasedirMixin
|
||||
from allmydata.scripts.common import BasedirMixin, NoDefaultBasedirMixin
|
||||
|
||||
class CreateClientOptions(NoDefaultBasedirMixin, usage.Options):
|
||||
class CreateClientOptions(BasedirMixin, usage.Options):
|
||||
optParameters = [
|
||||
["basedir", "C", None, "which directory to create the client in"],
|
||||
]
|
||||
|
@ -44,11 +44,6 @@ class CreateNode(unittest.TestCase):
|
||||
["create-client", "basedir", "extraarg"],
|
||||
run_by_human=False)
|
||||
|
||||
self.failUnlessRaises(usage.UsageError,
|
||||
runner.runner,
|
||||
["create-client"],
|
||||
run_by_human=False)
|
||||
|
||||
def test_introducer(self):
|
||||
basedir = self.workdir("test_introducer")
|
||||
c1 = os.path.join(basedir, "c1")
|
||||
|
Loading…
Reference in New Issue
Block a user