diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-11-29 15:55:19 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2022-03-14 12:08:47 +0100 |
| commit | 3e7bffc747fa61a8f3774b3ab2dbc9ea8c83e586 (patch) | |
| tree | b3a97380088509e407930a71c6cd48dc61df716d /mullvad-cli/src | |
| parent | 27b757b5e633a3abdbb038c726c78a5ff762d0f5 (diff) | |
| download | mullvadvpn-3e7bffc747fa61a8f3774b3ab2dbc9ea8c83e586.tar.xz mullvadvpn-3e7bffc747fa61a8f3774b3ab2dbc9ea8c83e586.zip | |
Capitalize each word of a device name in the CLI
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/cmds/account.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mullvad-cli/src/cmds/account.rs b/mullvad-cli/src/cmds/account.rs index c2068f24ee..c26f8bed69 100644 --- a/mullvad-cli/src/cmds/account.rs +++ b/mullvad-cli/src/cmds/account.rs @@ -128,10 +128,9 @@ impl Account { let device = rpc.get_device(()).await?.into_inner(); if !device.account_token.is_empty() { println!("Mullvad account: {}", device.account_token); - let inner_device = device.device.unwrap(); - println!("Device name : {}", inner_device.name); + let inner_device = Device::try_from(device.device.unwrap()).unwrap(); + println!("Device name : {}", inner_device.pretty_name()); if verbose { - let inner_device = Device::try_from(inner_device).unwrap(); println!("Device id : {}", inner_device.id); println!("Device pubkey : {}", inner_device.pubkey); } @@ -162,11 +161,11 @@ impl Account { let device = Device::try_from(device.clone()).unwrap(); if verbose { println!(); - println!("Name : {}", device.name); + println!("Name : {}", device.pretty_name()); println!("Id : {}", device.id); println!("Public key: {}", device.pubkey); } else { - println!("{}", device.name); + println!("{}", device.pretty_name()); } } |
