summaryrefslogtreecommitdiff
path: root/scripts/build-command-templates
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-command-templates')
-rwxr-xr-xscripts/build-command-templates10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/build-command-templates b/scripts/build-command-templates
index 876f5877c..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
@@ -192,12 +194,12 @@ def get_properties(p, default=None):
# so we get to emulate it
comp_exprs = []
for i in lists:
- comp_exprs.append("echo \"{0}\"".format(i.text))
+ comp_exprs.append(f'echo "{i.text}"')
for i in paths:
- comp_exprs.append("/bin/cli-shell-api listNodes {0}".format(i.text))
+ comp_exprs.append(f'/bin/cli-shell-api listNodes {i.text}')
for i in scripts:
- comp_exprs.append("sh -c \"{0}\"".format(i.text))
- comp_help = " && ".join(comp_exprs)
+ comp_exprs.append(f'sh -c "{i.text}"')
+ comp_help = ' && echo " " && '.join(comp_exprs)
props["comp_help"] = comp_help
except:
props["comp_help"] = []