From: Daira Hopwood Date: Tue, 2 Feb 2016 18:45:52 +0000 (+0000) Subject: Remove -u shortcut for 'tahoe ls --uri' which clashes with --node-url. fixes ticket... X-Git-Url: https://git.rkrishnan.org/pf/content/%22file:/(%5B%5E?a=commitdiff_plain;h=0d6fcf445e21f58024ed869f5e672eab2d4a2903;p=tahoe-lafs%2Ftahoe-lafs.git Remove -u shortcut for 'tahoe ls --uri' which clashes with --node-url. fixes ticket:1949, ticket:2137 Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index ef4fc71f..722c8d98 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -86,7 +86,7 @@ class ListAliasesOptions(FilesystemOptions): class ListOptions(FilesystemOptions): optFlags = [ ("long", "l", "Use long format: show file sizes, and timestamps."), - ("uri", "u", "Show file/directory URIs."), + ("uri", None, "Show file/directory URIs."), ("readonly-uri", None, "Show read-only file/directory URIs."), ("classify", "F", "Append '/' to directory names, and '*' to mutable."), ("json", None, "Show the raw JSON output."), diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index bed35871..789e177d 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -1242,6 +1242,19 @@ class Options(ReallyEqualMixin, unittest.TestCase): self.failUnlessEqual(o.aliases[DEFAULT_ALIAS], private_uri) self.failUnlessEqual(o.where, u"") + # -u for --node-url used to clash with -u for --uri (tickets #1949 and #2137). + o = parse2(["-u", "http://example.org:8111/"]) + self.failUnlessEqual(o['node-url'], "http://example.org:8111/") + self.failUnlessEqual(o.aliases[DEFAULT_ALIAS], private_uri) + self.failUnlessEqual(o.where, u"") + self.failIf(o["uri"]) + + o = parse2(["-u", "http://example.org:8111/", "--uri"]) + self.failUnlessEqual(o['node-url'], "http://example.org:8111/") + self.failUnlessEqual(o.aliases[DEFAULT_ALIAS], private_uri) + self.failUnlessEqual(o.where, u"") + self.failUnless(o["uri"]) + o = parse2(["--dir-cap", "root"]) self.failUnlessEqual(o['node-url'], "http://localhost:8080/") self.failUnlessEqual(o.aliases[DEFAULT_ALIAS], "root")