From d28041fbe46924511eafd5676061577d9ca45fed Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Thu, 13 Oct 2011 20:45:59 -0700
Subject: [PATCH] CLI: don't deprecate --mutable, small docs fixes. refs #1561

Also don't accept 'tahoe mkdir --format=chk'.
---
 docs/frontends/CLI.rst           | 8 ++++----
 src/allmydata/scripts/cli.py     | 8 ++++----
 src/allmydata/test/check_grid.py | 6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/docs/frontends/CLI.rst b/docs/frontends/CLI.rst
index ed8ddf65d..764cd7a6f 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 950f6a79d..bb48ef4d0 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 a9d362bd9..fbe8f5f13 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):