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

Function json_add_help_command

lightningd/jsonrpc.c:425–446  ·  view source on GitHub ↗

Used as a strmap_iterate function: returns true to continue */

Source from the content-addressed store, hash-verified

423
424/* Used as a strmap_iterate function: returns true to continue */
425static bool json_add_help_command(const char *cmdname,
426 struct cmd_and_usage *cmd,
427 struct json_help_info *hinfo)
428{
429 char *usage;
430
431 /* If they disallow deprecated APIs, don't even list them */
432 if (!command_deprecated_out_ok(hinfo->cmd, NULL,
433 cmd->command->depr_start,
434 cmd->command->depr_end)) {
435 return true;
436 }
437
438 usage = tal_fmt(tmpctx, "%s%s %s",
439 cmd->command->name,
440 cmd->command->depr_start ? " (DEPRECATED!)" : "",
441 cmd->usage);
442 json_object_start(hinfo->response, NULL);
443 json_add_string(hinfo->response, "command", usage);
444 json_object_end(hinfo->response);
445 return true;
446}
447
448static struct command_result *json_help(struct command *cmd,
449 const char *buffer,

Callers 1

json_helpFunction · 0.85

Calls 4

json_object_startFunction · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected