| 1749 | } |
| 1750 | |
| 1751 | static void setup_command_usage(struct plugin *p) |
| 1752 | { |
| 1753 | struct command *usage_cmd = new_command(tmpctx, p, "usage", |
| 1754 | "check-usage", |
| 1755 | COMMAND_TYPE_USAGE_ONLY); |
| 1756 | |
| 1757 | /* This is how common/param can tell it's just a usage request */ |
| 1758 | for (size_t i = 0; i < p->num_commands; i++) { |
| 1759 | struct command_result *res; |
| 1760 | |
| 1761 | usage_cmd->methodname = p->commands[i].name; |
| 1762 | res = p->commands[i].handle(usage_cmd, NULL, NULL); |
| 1763 | assert(res == &complete); |
| 1764 | assert(strmap_get(&p->usagemap, p->commands[i].name)); |
| 1765 | } |
| 1766 | } |
| 1767 | |
| 1768 | static void call_plugin_timer(struct plugin *p, struct timer *timer) |
| 1769 | { |
no test coverage detected