| 1303 | } |
| 1304 | |
| 1305 | static struct cmd_and_usage *command_add(struct jsonrpc *rpc, struct json_command *command) |
| 1306 | { |
| 1307 | struct cmd_and_usage *cmd; |
| 1308 | |
| 1309 | /* Check that we don't clobber a method */ |
| 1310 | if (strmap_get(&rpc->cmdmap, command->name)) |
| 1311 | return NULL; |
| 1312 | |
| 1313 | cmd = tal(rpc, struct cmd_and_usage); |
| 1314 | cmd->command = command; |
| 1315 | cmd->usage = NULL; |
| 1316 | strmap_add(&rpc->cmdmap, command->name, cmd); |
| 1317 | return cmd; |
| 1318 | } |
| 1319 | |
| 1320 | /* Built-in commands get called to construct usage string via param() */ |
| 1321 | static void setup_command_usage(struct lightningd *ld, |
no outgoing calls
no test coverage detected