Skip to content

bridge: fixes regarding the colorized output

Gokul Sivakumar netdev 3 versions – Applied

Status from this message: This series was applied to iproute2/iproute2.git (refs/heads/main):

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 0 repliesApplied
  2. v23 patches 4 repliesSuperseded
  3. v13 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Remove the unnecessary is_json_context() condition checks from patch 2/3 as the print_string() call is used with the argument PRINT_FP.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3bridge: reorder cmd line arg parsing to let "-c" detected as "color" optionbridge/bridge.c+1 -10 replies
2/3bridge: fdb: don't colorize the "dev" & "dst" keywords in "bridge -c fdb"bridge/fdb.c+8 -30 replies
3/3man: bridge: fix the typo to change "-c[lor]" into "-c[olor]" in man pageman/man8/bridge.8+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH iproute2 v3 0/3] bridge: fixes regarding the colorized output

v3:
- Remove the unnecessary is_json_context() condition checks from patch 2/3 as the print_string() call is used with the argument PRINT_FP.

v2:
- Replace the 2 newly introduced fprintf() func calls with print_string() to address Stephen's suggestion.

For the bridge cmd, the "colorize output" cmd line option's usage and the corresponding output does not seem to be consistent with the usage and the output of the "ip" cmds.

Example 1: As per the "colorize output" cmd line option documented in the man pages man/man8/ip.8 & man/man8/bridge.8, using "-c" with "ip" or the "bridge" should colorize the output. But this is working only with the "ip" cmd and for the "bridge" cmd, the option "-col" / "-colo" / "-color" needs to be used instead of just "-c".

Example 2: After fixing the inconsistency mentioned in Example 1,
- Running the cmd "$ ip -c neigh", will give the following output where the "172.16.12.250", "bridge0" & "04:d9:f5:c1:0c:74" fields are highlighted and not the fixed keywords "dev" & "lladdr".

172.16.12.250 dev bridge0 lladdr 04:d9:f5:c1:0c:74 REACHABLE

- But running the cmd "$ bridge -c fdb", will give the following output where "00:00:00:00:00:00", "dev", "vxlan100", "dst" & "2001:db8:2::1" are highlighted, even though "dev" & "dst" keywords are static.

00:00:00:00:00:00 dev vxlan100 dst 2001:db8:2::1 self permanent

Also fix a typo in man/man8/bridge.8 to change "-c[lor]" into "-c[olor]".

Gokul Sivakumar (3):
bridge: reorder cmd line arg parsing to let "-c" detected as "color"
option
bridge: fdb: don't colorize the "dev" & "dst" keywords in "bridge -c
fdb"
man: bridge: fix the typo to change "-c[lor]" into "-c[olor]" in man
page

 bridge/bridge.c   |  2 +-
 bridge/fdb.c      | 11 ++++++++---
 man/man8/bridge.8 |  2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1