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

Function choose_format

cli/lightning-cli.c:446–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446static enum format choose_format(const char *resp,
447 jsmntok_t **toks,
448 const char *method,
449 const char *command,
450 enum format format)
451{
452 /* If they specify a format, that's what we use. */
453 if (format != DEFAULT_FORMAT) {
454 /* But humans don't want to see the format hint! */
455 if (format == HUMAN)
456 delete_format_hint(resp, toks);
457 return format;
458 }
459
460 /* This works best when we order it. */
461 if (streq(method, "help") && command == NULL)
462 format = HELPLIST;
463 else
464 format = delete_format_hint(resp, toks);
465
466 return format;
467}
468
469static bool handle_notify(const char *buf, jsmntok_t *toks,
470 enum log_level notification_level,

Callers 1

mainFunction · 0.85

Calls 1

delete_format_hintFunction · 0.85

Tested by

no test coverage detected