Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions _Log.md
Original file line number Diff line number Diff line change
Expand Up @@ -42105,3 +42105,20 @@ top.
(new), pkg/cli/cli_request_testcmd.go (new), pkg/cli/monitor_traffic.go (new),
pkg/cli/cli_request_chassis.go (new), pkg/cli/cli_request_system.go (new),
pkg/cli/cli_request_security.go (new), pkg/cli/README.md, _Log.md

- **Timestamp**: 2026-07-08
**Action**: #4654 refactor — split pkg/cli/cli_show_interfaces.go (1396 LOC)
per render mode plus a shared RETH/kernel-query helper file. The RETH/member
display logic repeated across summary/terse/detail/extensive and drifted
(the #4328 family); collecting the shared helpers in one file removes the
drift surface. Pure code motion, behavior-identical: all 14 top-level
declarations moved verbatim (verified byte-for-byte against origin/master
via a go/parser decl-diff — identical=14, 0 bodydiff/missing/extra). The
netlink/sysfs query order and the exact rendered output are preserved; the
#4328 (RETH) + #3654 (host-inbound) output tests still pass. go build ./...
clean, go test ./pkg/cli/... green.
**File(s)**: pkg/cli/cli_show_interfaces.go (trimmed to dispatch + summary),
pkg/cli/cli_show_interfaces_terse.go (new), pkg/cli/cli_show_interfaces_detail.go
(new), pkg/cli/cli_show_interfaces_extensive.go (new),
pkg/cli/cli_show_interfaces_stats.go (new), pkg/cli/cli_show_interfaces_shared.go
(new), pkg/cli/README.md, _Log.md
26 changes: 26 additions & 0 deletions pkg/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@ sibling files (same package, so unexported helpers stay reachable):
The security-sensitive `--` end-of-options separators in the diagcmd/tcpdump
argv builders (#2084 / #4524 / #4527) moved verbatim.

## `show interfaces` render files (#4654)

The `show interfaces` presenters were historically one 1396-line
`cli_show_interfaces.go`, where the RETH/member display logic repeated
across the summary/terse/detail/extensive modes and drifted (the #4328
family of fixes). They are split per render mode plus a shared
RETH/kernel-query helper file (same package, so the unexported helpers
stay reachable). Pure code motion — the netlink/sysfs query order and the
visible output are byte-identical:

- `cli_show_interfaces.go` — the `showInterfaces` dispatch + summary
renderer, `showInterfacesRethMemberSummary`, and `showTunnelInterfaces`.
- `cli_show_interfaces_terse.go` — `showInterfacesTerse` (the tabular
`show interfaces terse` view, cluster-peer aware).
- `cli_show_interfaces_detail.go` — `showInterfacesDetail` plus
`showInterfacesRethDetail`, the synthesized bondless-reth aggregate /
absent-member block reused by the extensive view.
- `cli_show_interfaces_extensive.go` — `showInterfacesExtensive` /
`showInterfacesExtensiveFiltered`.
- `cli_show_interfaces_stats.go` — `showInterfacesStatistics` and
`showVlans` (the two small tabular summaries).
- `cli_show_interfaces_shared.go` — the shared RETH/kernel-query helpers
`dhcpLease`, `rethMemberLinkState`, `rethMemberAttrs`, and `baseIfName`,
so the four render modes resolve reth link state / member attrs / lease
data through one place and can no longer drift.

## Callers

`cmd/cli` (remote client), `cmd/xpfd` (when stdin is a TTY).
Expand Down
Loading