From: Zbigniew Jędrzejewski-Szmek Date: Thu, 13 Aug 2026 11:22:24 +0000 (+0200) Subject: verbs: wrap the help footer at print time X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ea090f41b389cb9448b4f1f81fe866a3cd27cb7;p=thirdparty%2Fsystemd.git verbs: wrap the help footer at print time The footer is now wrapped to min($COLUMNS, 80) when it is printed, so CommandDescription footers do not need to be hard-wrapped in the source, and make use of the available terminal width. Newlines embedded in the text are preserved and each line is wrapped independently, so explicit line breaks can still be used where needed, e.g. before the example command line in varlinkctl. The text is wrapped at max of 80 columns to avoid very wrong lines on wide terminals. Such lines are hard to read. A new helper is added for this. We already have format_strv_width in format-table, but it requires a strv, so we'd need to conver the data, and returns a formatted string, which we'd need to print ourselves. So overall, it seems better to add a dedicated helper. --- diff --git a/src/resolve/resolvconf-compat.c b/src/resolve/resolvconf-compat.c index 51e226da84d..8e4835b4f8d 100644 --- a/src/resolve/resolvconf-compat.c +++ b/src/resolve/resolvconf-compat.c @@ -28,12 +28,12 @@ COMMAND( .argspec = "-a INTERFACE footer) - printf("\n%s\n", cmd->footer); + r = print_wrapped(cmd->footer); + if (r < 0) + return r; r = print_man_links(cmd->man_pages); if (r < 0)