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

Function setup_command_usage

lightningd/jsonrpc.c:1325–1339  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1323
1324/* Built-in commands get called to construct usage string via param() */
1325static 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 == &param_failed);
1338 assert(strmap_get(&ld->jsonrpc->cmdmap, command->name)->usage);
1339}
1340
1341bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command,
1342 const char *usage TAKES)

Callers 1

jsonrpc_command_add_permFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected