Merge pull request from tahoe-lafs/2976.help-output-groups

Remove the attempt at grouping the subcommands.

Fixes: ticket:2976
This commit is contained in:
Jean-Paul Calderone 2019-03-29 13:02:38 -04:00 committed by GitHub
commit 3c68f5897a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 20 deletions
newsfragments
src/allmydata/scripts

@ -0,0 +1 @@
The confusing and misplaced sub-command group headings in `tahoe --help` output have been removed.

@ -17,13 +17,6 @@ from allmydata.util.eliotutil import (
eliot_logging_service,
)
def GROUP(s):
# Usage.parseOptions compares argv[1] against command[0], so it will
# effectively ignore any "subcommand" that starts with a newline. We use
# these to insert section headers into the --help output.
return [("\n(%s)" % s, None, None, None)]
_default_nodedir = get_default_nodedir()
NODEDIR_HELP = ("Specify which Tahoe node directory should be used. The "
@ -46,6 +39,14 @@ _control_node_dispatch = {
"restart": tahoe_restart.restart,
}
process_control_commands = [
["daemonize", None, tahoe_daemonize.DaemonizeOptions, "run a node in the background"],
["start", None, tahoe_start.StartOptions, "start a node in the background and confirm it started"],
["run", None, tahoe_run.RunOptions, "run a node without daemonizing"],
["stop", None, tahoe_stop.StopOptions, "stop a node"],
["restart", None, tahoe_restart.RestartOptions, "restart a node"],
]
class Options(usage.Options):
# unit tests can override these to point at StringIO instances
@ -53,24 +54,13 @@ class Options(usage.Options):
stdout = sys.stdout
stderr = sys.stderr
subCommands = ( GROUP("Administration")
+ create_node.subCommands
subCommands = ( create_node.subCommands
+ stats_gatherer.subCommands
+ admin.subCommands
+ GROUP("Controlling a node")
+ [
["daemonize", None, tahoe_daemonize.DaemonizeOptions, "run a node in the background"],
["start", None, tahoe_start.StartOptions, "start a node in the background and confirm it started"],
["run", None, tahoe_run.RunOptions, "run a node without daemonizing"],
["stop", None, tahoe_stop.StopOptions, "stop a node"],
["restart", None, tahoe_restart.RestartOptions, "restart a node"],
]
+ GROUP("Debugging")
+ process_control_commands
+ debug.subCommands
+ GROUP("Using the file store")
+ cli.subCommands
+ magic_folder_cli.subCommands
+ GROUP("Grid Management")
+ tahoe_invite.subCommands
)