cli: rewrite interface pretty printer in phyton3

The old version (bash) where slow and cluttered. This version is much
faster and easier to read / maintain.

Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
Richard Alpe
2023-09-06 16:11:59 +02:00
committed by Joachim Wiberg
parent 1ea658ad1d
commit 9e48fb09f6
3 changed files with 208 additions and 129 deletions
+6 -2
View File
@@ -239,9 +239,13 @@
</COMMAND>
</SWITCH>
<ACTION sym="script" interactive="false">
name="${KLISH_PARAM_name:-}"
if [ -n "$KLISH_PARAM_name" ]; then
sysrepocfg -f json -X -d operational -m ietf-interfaces | \
/lib/infix/json-cfg-pretty "ietf-interfaces" "$name"
/lib/infix/cli-pretty "ietf-interfaces" -n "$KLISH_PARAM_name"
else
sysrepocfg -f json -X -d operational -m ietf-interfaces | \
/lib/infix/cli-pretty "ietf-interfaces"
fi
</ACTION>
</COMMAND>