From 11a605d303bce5384a64ad887566c064eb4f206a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 30 Jul 2022 15:21:36 +0200 Subject: op-mode: T1748: vbash: beautify tab completion output/line breaks --- scripts/build-command-op-templates | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/build-command-op-templates b/scripts/build-command-op-templates index d4515b8db..b008596dc 100755 --- a/scripts/build-command-op-templates +++ b/scripts/build-command-op-templates @@ -27,6 +27,7 @@ import copy import functools from lxml import etree as ET +from textwrap import fill # Defaults validator_dir = "/opt/vyatta/libexec/validators" @@ -123,13 +124,15 @@ def make_node_def(props, command): node_def = "" if "help" in props: - node_def += "help: {0}\n".format(props["help"]) + help = props["help"] + help = fill(help, width=64, subsequent_indent='\t\t\t') + node_def += f'help: {help}\n' if "comp_help" in props: - node_def += "allowed: {0}\n".format(props["comp_help"]) + node_def += f'allowed: {props["comp_help"]}\n' if command is not None: - node_def += "run: {0}\n".format(command.text) + node_def += f'run: {command.text}\n' if debug: - print("The contents of the node.def file:\n", node_def) + print('Contents of the node.def file:\n', node_def) return node_def -- cgit v1.2.3