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

Enable JSON output for all blockchain commands #22

Merged
merged 2 commits into from
Nov 3, 2022
Merged

Conversation

the-flagship
Copy link
Contributor

This PR enables the oclif-builtin --json flag for all blockchain commands.

An explicit choice was made to do if (!flags.json) console.log(output) instead of using this.log("%O", output) because the latter loses coloring, which is kinda sad.

Example UX enabled by this change:

$ armada reservation list $(armada project list --owner=0xF62e<snip> --size=1 --json | jq -r .[0].id) --json | jq .[].host
"content3.usw2.testnet.armadanodes.com"
"content3.use2.testnet.armadanodes.com"

@@ -37,14 +37,16 @@ export default class ReservationCreate extends TransactionCommand {
const prices = nodeIds.map(() => parseUnits("1", 18));
CliUx.ux.action.start("- Submitting transaction");
const slot = { last: !!flags.spot, next: !flags.norenew };
console.log([projectId, nodeIds, prices, slot]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing this rogue debug log!

@the-flagship the-flagship merged commit 536d1cb into main Nov 3, 2022
@the-flagship the-flagship deleted the json-flag branch November 3, 2022 16:32
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