Skip to content

Commit

Permalink
[show] Issue in CLI output alignment with shorter alias names in intf…
Browse files Browse the repository at this point in the history
… 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)
  • Loading branch information
maulik-marvell authored Feb 16, 2021
1 parent 310d203 commit 327b292
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utilities_common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ def print_output_in_alias_mode(output, index):
if output.startswith("---"):
word = output.split()
dword = word[index]
if(len(dword) > iface_alias_converter.alias_max_length):
dword = dword[:len(dword) - iface_alias_converter.alias_max_length]
underline = dword.rjust(iface_alias_converter.alias_max_length,
'-')
word[index] = underline
Expand Down

0 comments on commit 327b292

Please sign in to comment.