diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index ef4fc71fe..722c8d983 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 bed358711..789e177d1 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")