ctl-client: Rename print_as_yaml -> print_for_human

The goal is to have this human friendly, not yaml.
srht-ci
Andri Yngvason 2023-01-15 17:10:18 +00:00
parent 0fc43ef757
commit bbea931f8c
1 changed files with 4 additions and 4 deletions

View File

@ -506,7 +506,7 @@ static bool json_has_content(json_t* root)
return false; return false;
} }
static void print_as_yaml(json_t* data, int level, bool needs_leading_newline) static void print_for_human(json_t* data, int level, bool needs_leading_newline)
{ {
size_t i; size_t i;
const char* key; const char* key;
@ -531,7 +531,7 @@ static void print_as_yaml(json_t* data, int level, bool needs_leading_newline)
needs_indent = true; needs_indent = true;
printf("%s: ", key); printf("%s: ", key);
print_as_yaml(value, level + 1, true); print_for_human(value, level + 1, true);
} }
break; break;
case JSON_ARRAY: case JSON_ARRAY:
@ -544,7 +544,7 @@ static void print_as_yaml(json_t* data, int level, bool needs_leading_newline)
print_indent(level); print_indent(level);
printf("- "); printf("- ");
print_as_yaml(value, level + 1, json_is_array(value)); print_for_human(value, level + 1, json_is_array(value));
} }
break; break;
case JSON_STRING: case JSON_STRING:
@ -572,7 +572,7 @@ static void print_event(struct jsonipc_request* event, unsigned flags)
} else { } else {
printf("\n%s:", event->method); printf("\n%s:", event->method);
if (event->params) if (event->params)
print_as_yaml(event->params, 1, true); print_for_human(event->params, 1, true);
else else
printf("<<null>\n"); printf("<<null>\n");
} }