mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-08 19:34:18 +00:00
Merge pull request #555 from tahoe-lafs/2976.help-output-groups
Remove the attempt at grouping the subcommands. Fixes: ticket:2976
This commit is contained in:
commit
3c68f5897a
1
newsfragments/2976.bugfix
Normal file
1
newsfragments/2976.bugfix
Normal file
@ -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
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user