Built-in commands get called to construct usage string via param() */
| 1323 | |
| 1324 | /* Built-in commands get called to construct usage string via param() */ |
| 1325 | static void setup_command_usage(struct lightningd *ld, |
| 1326 | struct json_command *command) |
| 1327 | { |
| 1328 | const struct command_result *res; |
| 1329 | struct command *dummy; |
| 1330 | |
| 1331 | /* Call it with minimal cmd, to fill out usagemap */ |
| 1332 | dummy = tal(tmpctx, struct command); |
| 1333 | dummy->mode = CMD_USAGE; |
| 1334 | dummy->ld = ld; |
| 1335 | dummy->json_cmd = command; |
| 1336 | res = command->dispatch(dummy, NULL, NULL, NULL); |
| 1337 | assert(res == ¶m_failed); |
| 1338 | assert(strmap_get(&ld->jsonrpc->cmdmap, command->name)->usage); |
| 1339 | } |
| 1340 | |
| 1341 | bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command, |
| 1342 | const char *usage TAKES) |
no outgoing calls
no test coverage detected