diff options
| author | David Lönnhager <david.l@mullvad.net> | 2023-12-29 17:56:06 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2023-12-29 17:56:06 +0100 |
| commit | 710a6fe96733236bfd9189b69b387f1fa75cd7a6 (patch) | |
| tree | 5904272e3efd08d1a8090be38ab5a819abfa41b4 /mullvad-cli | |
| parent | 2d1e643e235db3882ac47f439bf844b45e6ed5d4 (diff) | |
| parent | abb1f6521d91beb6a57f87877359ea90211c8484 (diff) | |
| download | mullvadvpn-710a6fe96733236bfd9189b69b387f1fa75cd7a6.tar.xz mullvadvpn-710a6fe96733236bfd9189b69b387f1fa75cd7a6.zip | |
Merge branch 'cli-add-account-id'
Diffstat (limited to 'mullvad-cli')
| -rw-r--r-- | mullvad-cli/src/cmds/account.rs | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/mullvad-cli/src/cmds/account.rs b/mullvad-cli/src/cmds/account.rs index 3b3d12b153..229c2a9aa0 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}"); |
