Skip to content

Commit

Permalink
lightning-cli: use human_readable for help messages (unescapes \n for…
Browse files Browse the repository at this point in the history
… us).

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Changed: lightning-cli: `help` messages using new-lines is now printed properly, enhancing readability and consistency.
  • Loading branch information
rustyrussell committed Feb 20, 2025
1 parent ca0c9e6 commit 44093f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/lightning-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 44093f0

Please sign in to comment.