cli: help command now also prints usage

The help command now adds command usage to its output by calling each
command handler in CMD_USAGE mode.

Instead of seeing, for example:

	decodepay
	    Decode {bolt11}, using {description} if necessary

we see:

	decodepay bolt11 [description]
	    Decode {bolt11}, using {description} if necessary

Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
Mark Beckwith
2018-09-13 10:57:24 -05:00
committed by Christian Decker
parent 1a4f355a7b
commit cbde3e20f7
3 changed files with 13 additions and 5 deletions

View File

@@ -622,7 +622,7 @@ def test_cli(node_factory):
.format(l1.daemon.lightning_dir),
'help']).decode('utf-8')
# Test some known output.
assert 'help\n List available commands, or give verbose help on one command' in out
assert 'help [command]\n List available commands, or give verbose help on one {command}' in out
# Test JSON output.
out = subprocess.check_output(['cli/lightning-cli',