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

Function choose_format

cli/lightning-cli.c:438–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls 1

delete_format_hintFunction · 0.85

Tested by

no test coverage detected