Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI commands: use built-in JSON functionality instead of re-implementing it as needed #5175

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

mat-if
Copy link
Contributor

@mat-if mat-if commented Jul 24, 2024

Summary

We had a few commands that manually added JSON output. This change moves them to use the ui.json function instead.

I modified ui.json to only attempt stringification of the input if it isn't already a string. The reason this was added is because the wallet:export/import flow would require a lot more substantial changes to work with pretty-printed JSON, and the wallet export RPC already exports the stringified JSON. I would prefer if this wasn't the case, but don't think the effort is worth tackling at this point.

I also slightly modified the output of some of the commands to be more valid JSON or clearer output.

config:get - added the config name so its a little easier to read
image

config:get --json
image

config - use the ui.card for normal display
image

Closes IFL-2820

Testing Plan

Documentation

N/A

Breaking Change

N/A

@mat-if mat-if force-pushed the mat/no-jsoncolorizer branch from 9cd2db2 to d4054d7 Compare July 25, 2024 16:12
@mat-if mat-if force-pushed the mat/no-jsoncolorizer branch from d4054d7 to 89f8e0f Compare July 25, 2024 20:49
@mat-if mat-if marked this pull request as ready for review July 25, 2024 20:55
@mat-if mat-if requested a review from a team as a code owner July 25, 2024 20:55
@NullSoldier NullSoldier merged commit 3c45707 into staging Jul 29, 2024
14 checks passed
@NullSoldier NullSoldier deleted the mat/no-jsoncolorizer branch July 29, 2024 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants