From 44093f09c3d783011fa6d6bb6a464029961ed9a8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 5 Feb 2025 15:06:47 +1030 Subject: [PATCH] lightning-cli: use human_readable for help messages (unescapes \n for us). Signed-off-by: Rusty Russell Changelog-Changed: lightning-cli: `help` messages using new-lines is now printed properly, enhancing readability and consistency. --- cli/lightning-cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/lightning-cli.c b/cli/lightning-cli.c index 63ef94c5b..10f8fffc2 100644 --- a/cli/lightning-cli.c +++ b/cli/lightning-cli.c @@ -197,8 +197,8 @@ static void human_help(char *buffer, const jsmntok_t *result) for (i = 0; i < tal_count(help); i++) { const jsmntok_t *command; command = json_get_member(buffer, help[i], "command"); - printf("%.*s\n\n", - command->end - command->start, buffer + command->start); + human_readable(buffer, command, '\n'); + printf("\n"); } tal_free(help);