From 7ac8154448ee34f18e7bf6881c229d7273600ddc Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 15 Jan 2023 17:10:18 +0000 Subject: [PATCH] ctl-client: Rename print_as_yaml -> print_for_human The goal is to have this human friendly, not yaml. --- src/ctl-client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ctl-client.c b/src/ctl-client.c index 6b58b8a..8cc8b86 100644 --- a/src/ctl-client.c +++ b/src/ctl-client.c @@ -506,7 +506,7 @@ static bool json_has_content(json_t* root) 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; const char* key; @@ -531,7 +531,7 @@ static void print_as_yaml(json_t* data, int level, bool needs_leading_newline) needs_indent = true; printf("%s: ", key); - print_as_yaml(value, level + 1, true); + print_for_human(value, level + 1, true); } break; case JSON_ARRAY: @@ -544,7 +544,7 @@ static void print_as_yaml(json_t* data, int level, bool needs_leading_newline) print_indent(level); printf("- "); - print_as_yaml(value, level + 1, json_is_array(value)); + print_for_human(value, level + 1, json_is_array(value)); } break; case JSON_STRING: @@ -572,7 +572,7 @@ static void print_event(struct jsonipc_request* event, unsigned flags) } else { printf("\n%s:", event->method); if (event->params) - print_as_yaml(event->params, 1, true); + print_for_human(event->params, 1, true); else printf("<\n"); }