mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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:
@@ -326,7 +326,8 @@ class Plugin(object):
|
||||
|
||||
def add_option(self, name: str, default: Optional[str],
|
||||
description: Optional[str],
|
||||
opt_type: str = "string", deprecated: bool = False) -> None:
|
||||
opt_type: str = "string", deprecated: bool = False,
|
||||
multi: bool = False) -> None:
|
||||
"""Add an option that we'd like to register with lightningd.
|
||||
|
||||
Needs to be called before `Plugin.run`, otherwise we might not
|
||||
@@ -349,6 +350,7 @@ class Plugin(object):
|
||||
'description': description,
|
||||
'type': opt_type,
|
||||
'value': None,
|
||||
'multi': multi,
|
||||
'deprecated': deprecated,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user