summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2023-05-23 10:29:01 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2023-05-24 10:16:47 +0200
commitf405135121f4924afd92ce428193c8f72be68ef2 (patch)
treed2880df540166691b20e893cf55935a7514de3de /mullvad-cli
parentc486ba42cda039ca7e8f620fb2ea9a7b6c20b41b (diff)
downloadmullvadvpn-f405135121f4924afd92ce428193c8f72be68ef2.tar.xz
mullvadvpn-f405135121f4924afd92ce428193c8f72be68ef2.zip
Add tunnel interface to output of `mullvad status`
Print the name of the tunnel interface when the app is in a connected state and the user requests verbose output by running `mullvad status -v`. To accomplish this, the state machine needs attach more metadata about the tunnel state when transitioning to the `Connected` state than prior to this change.
Diffstat (limited to 'mullvad-cli')
-rw-r--r--mullvad-cli/src/format.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/mullvad-cli/src/format.rs b/mullvad-cli/src/format.rs
index 8f8201814f..0d55c53173 100644
--- a/mullvad-cli/src/format.rs
+++ b/mullvad-cli/src/format.rs
@@ -14,6 +14,11 @@ pub fn print_state(state: &TunnelState, verbose: bool) {
"Connected to {}",
format_relay_connection(endpoint, location.as_ref(), verbose)
);
+ if verbose {
+ if let Some(tunnel_interface) = &endpoint.tunnel_interface {
+ println!("Tunnel interface: {tunnel_interface}")
+ }
+ }
}
Connecting { endpoint, location } => {
let ellipsis = if !verbose { "..." } else { "" };