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.
This commit is contained in:
@@ -28,12 +28,12 @@ COMMAND(
|
||||
.argspec = "-a INTERFACE <FILE\0"
|
||||
"-d INTERFACE\0",
|
||||
.footer =
|
||||
"This is a compatibility alias for the resolvectl(1) tool, providing native\n"
|
||||
"command line compatibility with the resolvconf(8) tool of various Linux\n"
|
||||
"distributions and BSD systems. Some options supported by other implementations\n"
|
||||
"are not supported and are ignored: -m, -u. Various options supported by other\n"
|
||||
"implementations are not supported and will cause the invocation to fail:\n"
|
||||
"-I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates,\n"
|
||||
"This is a compatibility alias for the resolvectl(1) tool, providing native "
|
||||
"command line compatibility with the resolvconf(8) tool of various Linux "
|
||||
"distributions and BSD systems. Some options supported by other implementations "
|
||||
"are not supported and are ignored: -m, -u. Various options supported by other "
|
||||
"implementations are not supported and will cause the invocation to fail: "
|
||||
"-I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates, "
|
||||
"--updates-are-enabled.",
|
||||
.option_namespace = "resolvconf",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user