cli: add --narrow option to user list#3589
Merged
juan-malbeclabs merged 1 commit intomainfrom Apr 25, 2026
Merged
Conversation
… flag Reduce the width of `doublezero user list` table output: - Abbreviate UserType display: IBRLWithAllocatedIP → IBRL+IP, EdgeFiltering → EdgeFilt - Abbreviate AccessPass display: SolanaValidator → SolVal, SolanaRPC → SolRPC, "expires epoch" → "exp epoch" - Abbreviate multicast group names longer than 10 chars to first4..last4 format - Add --narrow flag that hides groups, location, cyoa_type, accesspass, and tunnel_net columns
a1d4396 to
02293cb
Compare
juan-malbeclabs
approved these changes
Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
--narrowflag todoublezero user listthat produces a terminal-friendly table by droppinglocation,cyoa_type,accesspass, andtunnel_net, abbreviatinguser_type(e.g.IBRLWithAllocatedIP→IBRL+IP), and summarizinggroupsas oneP:entry and oneS:entry, each followed by+Nfor remaining groups of that role.Diff Breakdown
Change is additive only: one new CLI flag plus a dedicated narrow-render struct and helpers, alongside direct unit tests for the group summarizer and an end-to-end
--narrowexecution test.Key files (click to expand)
smartcontract/cli/src/user/list.rs— adds--narrowarg,UserDisplayNarrow(11-columnTabledstruct),abbreviate_name/abbreviate_user_type/narrow_groups/narrow_role_entryhelpers, new unit test fornarrow_groups, and a--narrowcase intest_cli_user_listthat also asserts every rendered row fits in 240 columns.CHANGELOG.md— entry underUnreleased→Changes→CLIdescribing the new flag and confirming default output is unchanged.Testing Verification
cargo test -p doublezero_cli --lib user::list::passes (13 tests), including the newnarrow_groupsunit test (empty, single-role, overflow, dual-role with independent+N) and the--narrowexecution test that checks header membership, hidden columns, and the 240-col row cap.cargo clippy -p doublezero_cli --all-targets -- -Dclippy::all -Dwarningsis clean.cargo +nightly fmt -p doublezero_cli --checkis clean.S:edge..reds+5in thegroupscolumn.