summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-04 09:37:13 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-05 07:08:21 -0300
commit8ac63a90b4ece7b16c773a9bcdd24316e5237855 (patch)
treee661808140de09e28cbb7447c3bcdb4b7f3fb9fd /mullvad-cli/src
parentd9e4e74af308b3644215c44ee9f729650a991124 (diff)
downloadmullvadvpn-8ac63a90b4ece7b16c773a9bcdd24316e5237855.tar.xz
mullvadvpn-8ac63a90b4ece7b16c773a9bcdd24316e5237855.zip
Allow printing tunnel option groups separately
Diffstat (limited to 'mullvad-cli/src')
-rw-r--r--mullvad-cli/src/cmds/tunnel.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs
index 3190800490..a034b3c22b 100644
--- a/mullvad-cli/src/cmds/tunnel.rs
+++ b/mullvad-cli/src/cmds/tunnel.rs
@@ -43,6 +43,9 @@ impl Command for Tunnel {
.possible_values(&["on", "off"]),
),
).setting(clap::AppSettings::SubcommandRequired),
+ ).subcommand(
+ clap::SubCommand::with_name("get")
+ .help("Retrieves the current setting for common tunnel options"),
)
}
@@ -51,6 +54,10 @@ impl Command for Tunnel {
Self::handle_openvpn_cmd(openvpn_matches)
} else if let Some(set_matches) = matches.subcommand_matches("set") {
Self::set_tunnel_option(set_matches)
+ } else if let Some(_) = matches.subcommand_matches("get") {
+ let tunnel_options = Self::get_tunnel_options()?;
+ Self::print_common_tunnel_options(&tunnel_options);
+ Ok(())
} else {
unreachable!("No tunnel command given")
}
@@ -80,7 +87,6 @@ impl Tunnel {
Self::set_openvpn_option(set_matches)
} else if let Some(_) = matches.subcommand_matches("get") {
let tunnel_options = Self::get_tunnel_options()?;
- Self::print_common_tunnel_options(&tunnel_options);
Self::print_openvpn_tunnel_options(tunnel_options.openvpn);
Ok(())
} else {