From fef7477de7e93fdb41b76d488dd026c2742f9fcf Mon Sep 17 00:00:00 2001 From: Jesse Abramowitz Date: Tue, 3 Dec 2024 10:56:39 -0500 Subject: [PATCH] cli json --- crates/test-cli/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/test-cli/src/lib.rs b/crates/test-cli/src/lib.rs index d4e18eb4c..4d82ab622 100644 --- a/crates/test-cli/src/lib.rs +++ b/crates/test-cli/src/lib.rs @@ -574,7 +574,11 @@ pub async fn run_command( }, CliCommand::GetOracleHeadings => { let oracles_data = get_oracle_headings(&api, &rpc).await?; - Ok(format!("{:?}", oracles_data)) + if cli.json { + Ok(serde_json::to_string_pretty(&oracles_data)?) + } else { + Ok(format!("{:?}", oracles_data)) + } }, CliCommand::GetTdxQuote { tss_endpoint, output_filename } => { let quote_bytes =