cli: get command now shows default values instead of 'not set' (#5796)

* get command now shows default values instead of 'not set'

* Add default indicator
This commit is contained in:
Michael Vines
2019-09-05 10:14:23 -07:00
committed by GitHub
parent c4a5442146
commit 5ffb6b874b
3 changed files with 44 additions and 21 deletions

View File

@@ -130,11 +130,14 @@ pub struct WalletConfig {
impl Default for WalletConfig {
fn default() -> WalletConfig {
let mut keypair_path = dirs::home_dir().expect("home directory");
keypair_path.extend(&[".config", "solana", "id.json"]);
WalletConfig {
command: WalletCommand::Balance(Pubkey::default()),
json_rpc_url: "http://127.0.0.1:8899".to_string(),
keypair: Keypair::new(),
keypair_path: "".to_string(),
keypair_path: keypair_path.to_str().unwrap().to_string(),
rpc_client: None,
}
}