mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
plugins: remove 'blank' option parsing for bool
bools must be set!
This commit is contained in:
committed by
Rusty Russell
parent
42cce55b45
commit
563b46814b
@@ -497,7 +497,7 @@ char *plugin_opt_set(const char *arg, struct plugin_opt *popt)
|
|||||||
if (streq(arg, "true") || streq(arg, "True") || streq(arg, "1")) {
|
if (streq(arg, "true") || streq(arg, "True") || streq(arg, "1")) {
|
||||||
*popt->value->as_bool = true;
|
*popt->value->as_bool = true;
|
||||||
} else if (streq(arg, "false") || streq(arg, "False")
|
} else if (streq(arg, "false") || streq(arg, "False")
|
||||||
|| streq(arg, "0") || streq(arg, "")) {
|
|| streq(arg, "0")) {
|
||||||
*popt->value->as_bool = false;
|
*popt->value->as_bool = false;
|
||||||
} else
|
} else
|
||||||
return tal_fmt(tmpctx, "%s does not parse as type %s",
|
return tal_fmt(tmpctx, "%s does not parse as type %s",
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ def test_option_types(node_factory):
|
|||||||
n = node_factory.get_node(options={
|
n = node_factory.get_node(options={
|
||||||
'plugin': plugin_path, 'str_opt': 'ok',
|
'plugin': plugin_path, 'str_opt': 'ok',
|
||||||
'int_opt': 22,
|
'int_opt': 22,
|
||||||
'bool_opt': '',
|
'bool_opt': 'true',
|
||||||
'flag_opt': None,
|
'flag_opt': None,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user