Skip to content

Commit 327b292

Browse files
[show] Issue in CLI output alignment with shorter alias names in intf naming mode "alias" sonic-net#1397 (sonic-net#1411)
#### What I did Added fix for Issue in CLI output alignment with shorter alias names in intf naming mode "alias" #### How I did it Added code to remove last few extra characters from string (-------…) using Slicing & Positive Indexing in python, to match the width to alias's name(not interface)
1 parent 310d203 commit 327b292

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

utilities_common/cli.py

+2
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ def print_output_in_alias_mode(output, index):
351351
if output.startswith("---"):
352352
word = output.split()
353353
dword = word[index]
354+
if(len(dword) > iface_alias_converter.alias_max_length):
355+
dword = dword[:len(dword) - iface_alias_converter.alias_max_length]
354356
underline = dword.rjust(iface_alias_converter.alias_max_length,
355357
'-')
356358
word[index] = underline

0 commit comments

Comments
 (0)