lightning-cli: use human_readable for help messages (unescapes \n for us).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: lightning-cli: `help` messages using new-lines is now printed properly, enhancing readability and consistency.
This commit is contained in:
Rusty Russell 2025-02-05 15:06:47 +10:30
parent ca0c9e63ad
commit 44093f09c3

View file

@ -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);