mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
Plugins: allow to specify plugin option type in libplugin.c, then specify it to autoclean options
This commit is contained in:
@@ -439,11 +439,12 @@ handle_getmanifest(struct command *getmanifest_cmd,
|
||||
|
||||
for (size_t i = 0; i < tal_count(opts); i++) {
|
||||
tal_append_fmt(¶ms, "{ 'name': '%s',"
|
||||
" 'type': 'string',"
|
||||
" 'description': '%s' }%s",
|
||||
opts[i].name,
|
||||
opts[i].description,
|
||||
i == tal_count(opts) - 1 ? "" : ",\n");
|
||||
" 'type': '%s',"
|
||||
" 'description': '%s' }%s",
|
||||
opts[i].name,
|
||||
opts[i].type,
|
||||
opts[i].description,
|
||||
i == tal_count(opts) - 1 ? "" : ",\n");
|
||||
}
|
||||
|
||||
tal_append_fmt(¶ms,
|
||||
@@ -507,7 +508,6 @@ static struct command_result *handle_init(struct command *init_cmd,
|
||||
&rpc_conn,
|
||||
".allow-deprecated-apis"),
|
||||
"true");
|
||||
|
||||
opttok = json_get_member(buf, params, "options");
|
||||
json_for_each_obj(i, t, opttok) {
|
||||
char *opt = json_strdup(NULL, buf, t);
|
||||
@@ -695,6 +695,7 @@ void plugin_main(char *argv[],
|
||||
while ((optname = va_arg(ap, const char *)) != NULL) {
|
||||
struct plugin_option o;
|
||||
o.name = optname;
|
||||
o.type = va_arg(ap, const char *);
|
||||
o.description = va_arg(ap, const char *);
|
||||
o.handle = va_arg(ap, char *(*)(const char *str, void *arg));
|
||||
o.arg = va_arg(ap, void *);
|
||||
|
||||
Reference in New Issue
Block a user