From: Daira Hopwood Date: Wed, 4 Feb 2015 00:10:21 +0000 (+0000) Subject: Quote the default node-directory correctly in help output. refs #2235 X-Git-Tag: allmydata-tahoe-1.10.1a1~77^2~1 X-Git-Url: https://git.rkrishnan.org/pf/frontends//%22file:/%22?a=commitdiff_plain;h=86726729b7acb3f46a25914073a2083533c2b6ee;p=tahoe-lafs%2Ftahoe-lafs.git Quote the default node-directory correctly in help output. refs #2235 Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/scripts/common.py b/src/allmydata/scripts/common.py index 16a66092..55cb3f08 100644 --- a/src/allmydata/scripts/common.py +++ b/src/allmydata/scripts/common.py @@ -3,7 +3,8 @@ import os, sys, urllib import codecs from twisted.python import usage from allmydata.util.assertutil import precondition -from allmydata.util.encodingutil import unicode_to_url, quote_output, argv_to_abspath +from allmydata.util.encodingutil import unicode_to_url, quote_output, \ + quote_local_unicode_path, argv_to_abspath from allmydata.util.fileutil import abspath_expanduser_unicode @@ -40,7 +41,7 @@ class BasedirOptions(BaseOptions): optParameters = [ ["basedir", "C", None, "Specify which Tahoe base directory should be used. [default: %s]" - % get_default_nodedir()], + % quote_local_unicode_path(_default_nodedir)], ] def parseArgs(self, basedir=None): diff --git a/src/allmydata/scripts/runner.py b/src/allmydata/scripts/runner.py index 08596707..1a6de258 100644 --- a/src/allmydata/scripts/runner.py +++ b/src/allmydata/scripts/runner.py @@ -6,7 +6,7 @@ from twisted.python import usage from allmydata.scripts.common import get_default_nodedir from allmydata.scripts import debug, create_node, startstop_node, cli, keygen, stats_gatherer, admin -from allmydata.util.encodingutil import quote_output, get_io_encoding +from allmydata.util.encodingutil import quote_output, quote_local_unicode_path, get_io_encoding def GROUP(s): # Usage.parseOptions compares argv[1] against command[0], so it will @@ -25,7 +25,7 @@ NODEDIR_HELP = ("Specify which Tahoe node directory should be used. The " "' which contains the mapping from alias name to root " "dirnode URI.") if _default_nodedir: - NODEDIR_HELP += " [default for most commands: " + quote_output(_default_nodedir) + "]" + NODEDIR_HELP += " [default for most commands: " + quote_local_unicode_path(_default_nodedir) + "]" class Options(usage.Options): # unit tests can override these to point at StringIO instances