-
Notifications
You must be signed in to change notification settings - Fork 387
Change example_crates
's output format to be JSON
#1932
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
Comments
@nymius hey can you pls assign this issue to me? |
Hello @sudo-rsingh, notice here I was seeking for feedback about the justifiability of the change. The project can decide this is not necessary or it breaks some workflow, and not merge it at the end, but I think is something trivial, so go ahead and start working on it if you want. |
Agree, this would be useful. |
I think this would be a good idea. I'd start by structuring the output for each command into types. Then have a There are a few example crates that stream output at they go I suppose they can be changed to make all that go to stderr. |
Hi everyone 👋, I’ve implemented a partial solution for this issue and wanted to confirm if I’m on the right track before proceeding further. I’ve used clap to add a
{
"next_unused_address":{
"index":6,
"address":"bcrt1qusvzrqjg4e570whysy20auytqun974w535jkxj"
},
"wallet_balance":{
"before_syncing":8749.99998872,
"after_syncing":8749.99998731
},
"syncing":{
"external_keychain_scanned_indexes":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],
"internal_keychain_scanned_indexes":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
},
"transaction":{
"status":"broadcasted",
"txid":"0610ee05c50562865ded2893a89e5236ef9370b40f1933911525e97c22a7b00f"
}
} Before I continue applying this approach to other examples, I have a couple of questions:
Looking forward to your feedback! Thanks in advance🙌 |
Hi @PranavKumar20, thanks for working on this. Answering your questions:
|
Describe the enhancement
Change all the
example_crates
output format to be JSON.Use case
Easier output information extraction through
jq
tool, for better integration with shell script or other external cli tools.Additional context
I have been using heavily the
example_crates
to test some workflows, mainly written as shell scripts or similar.The problem is I find more intuitive to extract information from JSON using
jq
than use regex to extract the same information from strings.There are any concerns about changing all the
example_crates
output format to be in JSON?Is this change behind the scope of the
example_crates
or it is a legit enhancement?May this break the development workflow of anyone testing things with
example_crates
too?The text was updated successfully, but these errors were encountered: