From eb3093d43ece7fec9c85fa9d944865ed52532a64 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 21 Oct 2019 08:48:21 -0700 Subject: [PATCH] Beautify show-account output (#6467) automerge --- cli/src/cli.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 9b6ec613ed..db9ef020a2 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -496,20 +496,20 @@ fn process_show_account( let account = rpc_client.get_account(account_pubkey)?; println!(); - println!("Public Key: {}", account_pubkey); - println!( - "{:?}", - build_balance_message(account.lamports, use_lamports_unit) + println_name_value("Public Key:", &account_pubkey.to_string()); + println_name_value( + "Balance:", + &build_balance_message(account.lamports, use_lamports_unit), ); - println!("Owner: {}", account.owner); - println!("Executable: {}", account.executable); + println_name_value("Owner:", &account.owner.to_string()); + println_name_value("Executable:", &account.executable.to_string()); if let Some(output_file) = output_file { let mut f = File::create(output_file)?; f.write_all(&account.data)?; println!(); println!("Wrote account data to {}", output_file); - } else { + } else if !account.data.is_empty() { use pretty_hex::*; println!("{:?}", account.data.hex_dump()); }