plugins: support concatenation of multiple args.

"multi" means that specifying a parameter twice will append, not override.
Multi args are always given as a JSON array, even if only one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Plugins: new "multi" field allows an option to be specified multiple times.
This commit is contained in:
Rusty Russell
2020-12-14 15:22:23 +10:30
parent 646c564ec5
commit 8a9976c4c1
6 changed files with 170 additions and 81 deletions

View File

@@ -120,6 +120,16 @@ def test_option_types(node_factory):
assert not n.daemon.running
assert n.daemon.is_in_stderr("--flag_opt: doesn't allow an argument")
n = node_factory.get_node(options={
'plugin': plugin_path,
'str_optm': ['ok', 'ok2'],
'int_optm': [11, 12, 13],
})
assert n.daemon.is_in_log(r"option str_optm \['ok', 'ok2'\] <class 'list'>")
assert n.daemon.is_in_log(r"option int_optm \[11, 12, 13\] <class 'list'>")
n.stop()
def test_millisatoshi_passthrough(node_factory):
""" Ensure that Millisatoshi arguments and return work.