From b079f32da2aa0746b71a1246449ae63d73eb523f Mon Sep 17 00:00:00 2001
From: david-sarah <david-sarah@jacaranda.org>
Date: Mon, 11 Jan 2010 20:39:35 -0800
Subject: [PATCH] Split tahoe --help options into groups.

---
 src/allmydata/scripts/create_node.py |  5 ++--
 src/allmydata/scripts/runner.py      | 36 ++++++++--------------------
 2 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/src/allmydata/scripts/create_node.py b/src/allmydata/scripts/create_node.py
index f47ccc99..7e49ba43 100644
--- a/src/allmydata/scripts/create_node.py
+++ b/src/allmydata/scripts/create_node.py
@@ -164,9 +164,8 @@ def create_introducer(basedir, config, out=sys.stdout, err=sys.stderr):
 
 
 subCommands = [
-    ["create-node", None, CreateNodeOptions, "Create a node that acts as a client, server or both."],
-    ["create-client", None, CreateClientOptions, "Create a client node (with storage initially disabled)."],
-    ["create-introducer", None, CreateIntroducerOptions, "Create an introducer."],
+    ["create-client", None, CreateClientOptions, "Create a client node."],
+    ["create-introducer", None, CreateIntroducerOptions, "Create a introducer node."],
 
 ]
 
diff --git a/src/allmydata/scripts/runner.py b/src/allmydata/scripts/runner.py
index 1ac8984e..235cc2a0 100644
--- a/src/allmydata/scripts/runner.py
+++ b/src/allmydata/scripts/runner.py
@@ -10,40 +10,24 @@ pkg_resources.require('allmydata-tahoe')
 from allmydata.scripts.common import BaseOptions
 import debug, create_node, startstop_node, cli, keygen, stats_gatherer
 
-def group(s):
-    return [["\n" + s, None, None, None]]
-
-_commandUsage = ( group("Administration")
-                +   create_node.subCommands
-                +   keygen.subCommands
-                +   stats_gatherer.subCommands
-                + group("Controlling a node")
-                +   startstop_node.subCommands
-                + group("Debugging")
-                +   debug.subCommands
-                + group("Using the filesystem")
-                +   cli.subCommands
-                )
-
-_subCommands = filter(lambda (a, b, c, d): not a.startswith("\n"), _commandUsage)
-_synopsis = "Usage:  tahoe <command> [command options]"
+_general_commands = ( create_node.subCommands
+                    + keygen.subCommands
+                    + stats_gatherer.subCommands
+                    + debug.subCommands
+                    + cli.subCommands
+                    )
 
 class Options(BaseOptions, usage.Options):
-    synopsis = _synopsis
-    subCommands = _subCommands
+    synopsis = "Usage:  tahoe <command> [command options]"
 
-    def getUsage(self, **kwargs):
-        t = _Usage().getUsage(**kwargs)
-        return t + "\nPlease run 'tahoe <command> --help' for more details on each command.\n"
+    subCommands = []
+    subCommands += _general_commands
+    subCommands += startstop_node.subCommands
 
     def postOptions(self):
         if not hasattr(self, 'subOptions'):
             raise usage.UsageError("must specify a command")
 
-class _Usage(BaseOptions, usage.Options):
-    synopsis = _synopsis
-    subCommands = _commandUsage
-
 def runner(argv,
            run_by_human=True,
            stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr,
-- 
2.45.2