summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-06-20 21:08:21 +0200
committerChristian Poessinger <christian@poessinger.com>2022-06-20 21:37:32 +0200
commitc73c401eba2495f7ea343020e5a643709bb37bc7 (patch)
treef7d838575956c2b28c2051f568c7e01b21694a28 /scripts
parent32df4dc8fbd28115c0c3fa7f529db9377fdfe8b5 (diff)
downloadvyos-1x-c73c401eba2495f7ea343020e5a643709bb37bc7.tar.gz
vyos-1x-c73c401eba2495f7ea343020e5a643709bb37bc7.zip
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-command-templates2
1 files changed, 2 insertions, 0 deletions
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