summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'mullvad-cli/src')
-rw-r--r--mullvad-cli/src/cmds/tunnel.rs21
1 files changed, 15 insertions, 6 deletions
diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs
index f44a6b8cf5..c62755f493 100644
--- a/mullvad-cli/src/cmds/tunnel.rs
+++ b/mullvad-cli/src/cmds/tunnel.rs
@@ -57,8 +57,9 @@ impl Tunnel {
if let Some(set_matches) = matches.subcommand_matches("set") {
Self::set_openvpn_option(set_matches)
} else if let Some(_) = matches.subcommand_matches("get") {
- let openvpn_options = Self::get_tunnel_options()?.openvpn;
- Self::print_openvpn_tunnel_options(openvpn_options);
+ let tunnel_options = Self::get_tunnel_options()?;
+ Self::print_common_tunnel_options(&tunnel_options);
+ Self::print_openvpn_tunnel_options(tunnel_options.openvpn);
Ok(())
} else {
unreachable!("Unrecognized subcommand");
@@ -103,6 +104,18 @@ impl Tunnel {
Ok(rpc.get_tunnel_options()?)
}
+ fn print_common_tunnel_options(options: &TunnelOptions) {
+ println!("Common tunnel options");
+ println!(
+ "\tIPv6: {}",
+ if options.openvpn.enable_ipv6 {
+ "on"
+ } else {
+ "off"
+ }
+ );
+ }
+
fn print_openvpn_tunnel_options(options: OpenVpnTunnelOptions) {
println!("OpenVPN tunnel options");
println!(
@@ -111,9 +124,5 @@ impl Tunnel {
.mssfix
.map_or_else(|| "UNSET".to_string(), |v| v.to_string())
);
- println!(
- "\tIPv6: {}",
- if options.enable_ipv6 { "on" } else { "off" }
- );
}
}