| 436 | } |
| 437 | |
| 438 | static 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 | |
| 461 | static bool handle_notify(const char *buf, jsmntok_t *toks, |
| 462 | enum log_level notification_level, |
no test coverage detected