| 1394 | -----------------------------------------------------------------------------*/ |
| 1395 | |
| 1396 | static struct command_result *either(struct command *cmd, |
| 1397 | const char *name, |
| 1398 | const char *buffer, |
| 1399 | const jsmntok_t *tok, |
| 1400 | const char *name1, |
| 1401 | const char *name2, |
| 1402 | const jsmntok_t **ret) |
| 1403 | { |
| 1404 | *ret = json_get_member(buffer, tok, name1); |
| 1405 | if (*ret) |
| 1406 | return NULL; |
| 1407 | *ret = json_get_member(buffer, tok, name2); |
| 1408 | if (*ret) |
| 1409 | return NULL; |
| 1410 | return command_fail_badparam(cmd, name, buffer, tok, |
| 1411 | tal_fmt(tmpctx, "must have either %s or %s", name1, name2)); |
| 1412 | } |
| 1413 | |
| 1414 | static struct command_result *param_route_hops(struct command *cmd, |
| 1415 | const char *name, |
no test coverage detected