From: Brian Warner Date: Fri, 14 Oct 2011 03:45:59 +0000 (-0700) Subject: CLI: don't deprecate --mutable, small docs fixes. refs #1561 X-Git-Tag: allmydata-tahoe-1.9.0b1~2 X-Git-Url: https://git.rkrishnan.org/simplejson//%22%3C?a=commitdiff_plain;h=d28041fbe46924511eafd5676061577d9ca45fed;p=tahoe-lafs%2Ftahoe-lafs.git CLI: don't deprecate --mutable, small docs fixes. refs #1561 Also don't accept 'tahoe mkdir --format=chk'. --- diff --git a/docs/frontends/CLI.rst b/docs/frontends/CLI.rst index ed8ddf65..764cd7a6 100644 --- a/docs/frontends/CLI.rst +++ b/docs/frontends/CLI.rst @@ -261,9 +261,9 @@ Command Syntax Summary ``tahoe webopen [PATH]`` -``tahoe put [--format=FORMAT] [FROMLOCAL|-]`` +``tahoe put [--mutable] [FROMLOCAL|-]`` -``tahoe put [--format=FORMAT] FROMLOCAL|- TOPATH`` +``tahoe put [--mutable] FROMLOCAL|- TOPATH`` ``tahoe put [FROMLOCAL|-] mutable-file-writecap`` @@ -394,7 +394,7 @@ Command Examples from the following path. When the source file is named "``-``", the contents are taken from stdin. -``tahoe put file.txt --format=SDMF`` +``tahoe put file.txt --mutable`` Create a new (SDMF) mutable file, fill it with the contents of ``file.txt``, and print the new write-cap to stdout. @@ -402,7 +402,7 @@ Command Examples ``tahoe put file.txt MUTABLE-FILE-WRITECAP`` Replace the contents of the given mutable file with the contents of - ``file.txt`` and prints the same write-cap to stdout. + ``file.txt`` and print the same write-cap to stdout. ``tahoe cp file.txt tahoe:uploaded.txt`` diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index 950f6a79..bb48ef4d 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -51,14 +51,14 @@ class VDriveOptions(BaseOptions): class MakeDirectoryOptions(VDriveOptions): optParameters = [ - ("format", None, None, "Create directory with the given format: SDMF and MDMF for mutable. (case-insensitive)"), + ("format", None, None, "Create a directory with the given format: SDMF or MDMF (case-insensitive)"), ] def parseArgs(self, where=""): self.where = argv_to_unicode(where) if self['format']: - if self['format'].upper() not in ("SDMF", "MDMF", "CHK"): + if self['format'].upper() not in ("SDMF", "MDMF"): raise usage.UsageError("%s is an invalid format" % self['format']) def getSynopsis(self): @@ -170,10 +170,10 @@ Examples: class PutOptions(VDriveOptions): optFlags = [ - ("mutable", "m", "Create a mutable file instead of an immutable one. (DEPRECATED, use --format=SDMF)"), + ("mutable", "m", "Create a mutable file instead of an immutable one (like --format=SDMF)"), ] optParameters = [ - ("format", None, None, "Create file with the given format: SDMF and MDMF for mutable, CHK (default) for immutable. (case-insensitive)"), + ("format", None, None, "Create a file with the given format: SDMF and MDMF for mutable, CHK (default) for immutable. (case-insensitive)"), ] def parseArgs(self, arg1=None, arg2=None): diff --git a/src/allmydata/test/check_grid.py b/src/allmydata/test/check_grid.py index a9d362bd..fbe8f5f1 100644 --- a/src/allmydata/test/check_grid.py +++ b/src/allmydata/test/check_grid.py @@ -30,8 +30,8 @@ To set up the client node, do the following: tahoe put -d DIR FILE testgrid:old.MD5SUM tahoe put -d DIR FILE testgrid:recent.MD5SUM tahoe put -d DIR FILE testgrid:recentdir/recent.MD5SUM - echo "" | tahoe put -d DIR --format=SDMF testgrid:log - echo "" | tahoe put -d DIR --format=SDMF testgrid:recentlog + echo "" | tahoe put -d DIR --mutable testgrid:log + echo "" | tahoe put -d DIR --mutable testgrid:recentlog This script will perform the following steps (the kind of compatibility that is being tested is in [brackets]): @@ -189,7 +189,7 @@ class GridTester: self.cli("put", "-", "testgrid:"+fn, stdin=data, ignore_stderr=True) def put_mutable(self, fn, data): - self.cli("put", "--format=SDMF", "-", "testgrid:"+fn, + self.cli("put", "--mutable", "-", "testgrid:"+fn, stdin=data, ignore_stderr=True) def update(self, fn):