summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-04 09:17:08 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-05 07:08:21 -0300
commit6ed7fb2d27144e7733fcd739c11cfc111dc5949c (patch)
treed93d1dcf631804c1a862e9d0a7fed29c52da0d4f /mullvad-cli
parent12b7a3a7910eb371603f6a0754a4e5829f01ee66 (diff)
downloadmullvadvpn-6ed7fb2d27144e7733fcd739c11cfc111dc5949c.tar.xz
mullvadvpn-6ed7fb2d27144e7733fcd739c11cfc111dc5949c.zip
Print Enable IPv6 option as a common tunnel option
Diffstat (limited to 'mullvad-cli')
-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" }
- );
}
}