smartcontract/cli: improve tenant get output with table/JSON formatting#3148
Open
juan-malbeclabs wants to merge 4 commits intomainfrom
Open
smartcontract/cli: improve tenant get output with table/JSON formatting#3148juan-malbeclabs wants to merge 4 commits intomainfrom
juan-malbeclabs wants to merge 4 commits intomainfrom
Conversation
vihu
reviewed
Mar 2, 2026
smartcontract/cli/src/tenant/get.rs
Outdated
|
|
||
| #[derive(Tabled, Serialize)] | ||
| struct AdminDisplay { | ||
| #[tabled(rename = "administrator")] |
Contributor
There was a problem hiding this comment.
Is the rename necessary if it's the same as the field (above as well), just wondering whether it would work as is without the #[tabled(rename=...)] (assuming field is the name we want to keep in the table)
Contributor
There was a problem hiding this comment.
This applies to those in ConfigDisplay too.
Contributor
Author
There was a problem hiding this comment.
yes, changed.
Contributor
Author
|
In this other PR #3156 , I applied the same changes to the remaining commands to standardize both the human-readable output and the JSON output for integrations. |
elitegreg
approved these changes
Mar 3, 2026
smartcontract/cli/src/tenant/get.rs
Outdated
|
|
||
| #[derive(Tabled, Serialize)] | ||
| struct AdminDisplay { | ||
| #[tabled(rename = "administrator")] |
Contributor
There was a problem hiding this comment.
This applies to those in ConfigDisplay too.
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
--jsonflag totenant getcommand for machine-readable outputtabledfor human-readable display--jsonand admin presenceDiff Breakdown
Single-file change adding structured output (table + JSON) to the
tenant getCLI command.Key files (click to expand)
smartcontract/cli/src/tenant/get.rs— rewrote output logic to usetabledtables andserde_jsonfor--jsonmode; addedConfigDisplayandAdminDisplaystructs; expanded testsTesting Verification
--jsonflag × admin presence are exercised