mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
cli: implement new 'flattened JSON' mode.
Much nicer for grepping, since `{ "foo": { "bar": [7] } }` is turned into
`foo.bar[0]=7`.
Changelog-Added: cli: New `--flat` mode for easy grepping.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
679d3494b4
commit
abb16b4226
@@ -1063,6 +1063,17 @@ def test_cli(node_factory):
|
||||
assert [l for l in lines if l.startswith('help=')] == []
|
||||
assert [l for l in lines if l.startswith('format-hint=')] == []
|
||||
|
||||
# Flat format is great for grep. LONG LIVE UNIX!
|
||||
out = subprocess.check_output(['cli/lightning-cli',
|
||||
'--network={}'.format(TEST_NETWORK),
|
||||
'--lightning-dir={}'
|
||||
.format(l1.daemon.lightning_dir),
|
||||
'-F',
|
||||
'help']).decode('utf-8')
|
||||
lines = out.splitlines()
|
||||
# Everything is a help[XX]= line, except format-hint.
|
||||
assert [l for l in lines if not re.search(r'^help\[[0-9]*\].', l)] == ['format-hint=simple']
|
||||
|
||||
|
||||
def test_daemon_option(node_factory):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user