From c73c401eba2495f7ea343020e5a643709bb37bc7 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 20 Jun 2022 21:08:21 +0200 Subject: T1748: vbash: beautify tab completion output/line breaks Indention for multi-line help strings should be auto calculated and not be a human problem. This way we ensure that there is a consistent CLI with predictable newlines at a predictable position. --- scripts/build-command-templates | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/build-command-templates b/scripts/build-command-templates index 729fc864c..c8ae83d9d 100755 --- a/scripts/build-command-templates +++ b/scripts/build-command-templates @@ -27,6 +27,7 @@ import copy import functools from lxml import etree as ET +from textwrap import fill # Defaults @@ -130,6 +131,7 @@ def get_properties(p, default=None): # DNS forwarding for instance has multiple defaults - specified as whitespace separated list tmp = ', '.join(default.text.split()) help += f' (default: {tmp})' + help = fill(help, width=64, subsequent_indent='\t\t\t') props["help"] = help except: pass -- cgit v1.2.3