diff options
| author | David Lönnhager <david.l@mullvad.net> | 2023-12-28 17:07:15 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2023-12-29 17:55:11 +0100 |
| commit | 31e8952a3e96ed70856d7b15a2fddb0a95acceea (patch) | |
| tree | 618ce4cb5e19b371270ee5d90b299e7c8c3c09c6 | |
| parent | cf1a16cf77ab65676e133d896e50096445d53e77 (diff) | |
| download | mullvadvpn-31e8952a3e96ed70856d7b15a2fddb0a95acceea.tar.xz mullvadvpn-31e8952a3e96ed70856d7b15a2fddb0a95acceea.zip | |
Show account id in the CLI with 'mullvad account get -v'
| -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}"); |
