| 1189 | } |
| 1190 | |
| 1191 | static void setup_command_usage(struct plugin *p) |
| 1192 | { |
| 1193 | struct command *usage_cmd = tal(tmpctx, struct command); |
| 1194 | |
| 1195 | /* This is how common/param can tell it's just a usage request */ |
| 1196 | usage_cmd->usage_only = true; |
| 1197 | usage_cmd->plugin = p; |
| 1198 | for (size_t i = 0; i < p->num_commands; i++) { |
| 1199 | struct command_result *res; |
| 1200 | |
| 1201 | usage_cmd->methodname = p->commands[i].name; |
| 1202 | res = p->commands[i].handle(usage_cmd, NULL, NULL); |
| 1203 | assert(res == &complete); |
| 1204 | assert(strmap_get(&p->usagemap, p->commands[i].name)); |
| 1205 | } |
| 1206 | } |
| 1207 | |
| 1208 | static void call_plugin_timer(struct plugin *p, struct timer *timer) |
| 1209 | { |