MCPcopy Create free account
hub / github.com/ElementsProject/lightning / setup_command_usage

Function setup_command_usage

lightningd/jsonrpc.c:1321–1335  ·  view source on GitHub ↗

Built-in commands get called to construct usage string via param() */

Source from the content-addressed store, hash-verified

1319
1320/* Built-in commands get called to construct usage string via param() */
1321static 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 == &param_failed);
1334 assert(strmap_get(&ld->jsonrpc->cmdmap, command->name)->usage);
1335}
1336
1337bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command,
1338 const char *usage TAKES)

Callers 1

jsonrpc_command_add_permFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected