From: David-Sarah Hopwood <david-sarah@jacaranda.org>
Date: Thu, 1 Nov 2012 23:40:06 +0000 (+0000)
Subject: CLI: fix synopsis for 'tahoe ls'. fixes #1839
X-Git-Tag: allmydata-tahoe-1.10a1~45
X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/simplejson/statistics?a=commitdiff_plain;h=1ffed22651478612f63d3abf31ee07798dec47e9;p=tahoe-lafs%2Ftahoe-lafs.git

CLI: fix synopsis for 'tahoe ls'. fixes #1839

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
---

diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py
index bb48ef4d..6758fe7d 100644
--- a/src/allmydata/scripts/cli.py
+++ b/src/allmydata/scripts/cli.py
@@ -106,9 +106,14 @@ class ListOptions(VDriveOptions):
     def parseArgs(self, where=""):
         self.where = argv_to_unicode(where)
 
+    def getSynopsis(self):
+        return "Usage:  %s ls [options] [PATH]" % (self.command_name,)
+
     longdesc = """
     List the contents of some portion of the grid.
 
+    If PATH is omitted, "tahoe:" is assumed.
+
     When the -l or --long option is used, each line is shown in the
     following format:
 
diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py
index c2dad120..0edcd78a 100644
--- a/src/allmydata/test/test_cli.py
+++ b/src/allmydata/test/test_cli.py
@@ -594,6 +594,10 @@ class Help(unittest.TestCase):
         self.failUnlessIn(" put [options] LOCAL_FILE REMOTE_FILE", help)
         self.failUnlessIn("% cat FILE | tahoe put", help)
 
+    def test_ls(self):
+        help = str(cli.ListOptions())
+        self.failUnlessIn(" ls [options] [PATH]", help)
+
     def test_unlink(self):
         help = str(cli.UnlinkOptions())
         self.failUnlessIn(" unlink [options] REMOTE_FILE", help)