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