Built-in commands get called to construct usage string via param() */
| 1165 | |
| 1166 | /* Built-in commands get called to construct usage string via param() */ |
| 1167 | static void setup_command_usage(struct lightningd *ld, |
| 1168 | struct json_command *command) |
| 1169 | { |
| 1170 | const struct command_result *res; |
| 1171 | struct command *dummy; |
| 1172 | |
| 1173 | /* Call it with minimal cmd, to fill out usagemap */ |
| 1174 | dummy = tal(tmpctx, struct command); |
| 1175 | dummy->mode = CMD_USAGE; |
| 1176 | dummy->ld = ld; |
| 1177 | dummy->json_cmd = command; |
| 1178 | res = command->dispatch(dummy, NULL, NULL, NULL); |
| 1179 | assert(res == ¶m_failed); |
| 1180 | assert(strmap_get(&ld->jsonrpc->usagemap, command->name)); |
| 1181 | } |
| 1182 | |
| 1183 | bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command, |
| 1184 | const char *usage TAKES) |
no outgoing calls
no test coverage detected