* Returned by all subcommands on success. */
| 19 | * Returned by all subcommands on success. |
| 20 | */ |
| 21 | static struct command_result *plugin_dynamic_list_plugins(struct plugin_command *pcmd, |
| 22 | const struct plugins *plugins) |
| 23 | { |
| 24 | struct json_stream *response; |
| 25 | const struct plugin *p; |
| 26 | |
| 27 | response = json_stream_success(pcmd->cmd); |
| 28 | json_add_string(response, "command", pcmd->subcmd); |
| 29 | json_array_start(response, "plugins"); |
| 30 | list_for_each(&plugins->plugins, p, list) { |
| 31 | json_object_start(response, NULL); |
| 32 | json_add_string(response, "name", p->cmd); |
| 33 | json_add_bool(response, "active", |
| 34 | p->plugin_state == INIT_COMPLETE); |
| 35 | json_add_bool(response, "dynamic", p->dynamic); |
| 36 | json_object_end(response); |
| 37 | } |
| 38 | json_array_end(response); |
| 39 | return command_success(pcmd->cmd, response); |
| 40 | } |
| 41 | |
| 42 | struct command_result *plugin_cmd_killed(struct plugin_command *pcmd, |
| 43 | struct plugin *plugin, const char *msg) |
no test coverage detected