From 31e8952a3e96ed70856d7b15a2fddb0a95acceea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20L=C3=B6nnhager?= Date: Thu, 28 Dec 2023 17:07:15 +0100 Subject: [PATCH] Show account id in the CLI with 'mullvad account get -v' --- mullvad-cli/src/cmds/account.rs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mullvad-cli/src/cmds/account.rs b/mullvad-cli/src/cmds/account.rs index 3b3d12b153a7..229c2a9aa0bf 100644 --- a/mullvad-cli/src/cmds/account.rs +++ b/mullvad-cli/src/cmds/account.rs @@ -106,18 +106,24 @@ impl Account { match state { DeviceState::LoggedIn(device) => { - println!("Mullvad account: {}", device.account_token); - println!("Device name : {}", device.device.pretty_name()); - if verbose { - println!("Device id : {}", device.device.id); - println!("Device pubkey : {}", device.device.pubkey); - println!("Device created : {}", device.device.created,); - } - let expiry = rpc.get_account_data(device.account_token).await?; + println!("{:<20}{}", "Mullvad account:", device.account_token); + + let data = rpc.get_account_data(device.account_token).await?; println!( - "Expires at : {}", - expiry.expiry.with_timezone(&chrono::Local), + "{:<20}{}", + "Expires at:", + data.expiry.with_timezone(&chrono::Local) ); + if verbose { + println!("{:<20}{}", "Account id:", data.id); + } + + println!("{:<20}{}", "Device name:", device.device.pretty_name()); + if verbose { + println!("{:<20}{}", "Device id:", device.device.id); + println!("{:<20}{}", "Device pubkey:", device.device.pubkey); + println!("{:<20}{}", "Device created:", device.device.created,); + } } DeviceState::LoggedOut => { println!("{NOT_LOGGED_IN_MESSAGE}");