diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-09-09 13:11:47 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-09-09 13:11:47 +0200 |
| commit | b81fdd74657e37375688ccf022e242a5167d607e (patch) | |
| tree | 9734b6d909e1414db2ece5cd8d467cf8613fe7f8 | |
| parent | 8f30eed23edceafcbf25ad103b1704a6ef139208 (diff) | |
| parent | c0d6f7f8899d26f310c8cbc31a730610e170f2f5 (diff) | |
| download | mullvadvpn-b81fdd74657e37375688ccf022e242a5167d607e.tar.xz mullvadvpn-b81fdd74657e37375688ccf022e242a5167d607e.zip | |
Merge branch 'optionally-print-location-in-cli'
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/status.rs | 17 |
2 files changed, 16 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bdda6f1bcb..0937766d80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Line wrap the file at 100 chars. Th - WireGuard key page now shows a label explaining why buttons are disabled when in a blocked state - WireGuard key generation will try to replace old key if one exists. - Show banner about new app versions only if current platform has changes in latest release. +- Don't make a GeoIP lookup by default in CLI status command. Add --location flag for enabling it. ### Fixed - Fix old settings deserialization to allow migrating settings from versions older than 2019.6. diff --git a/mullvad-cli/src/cmds/status.rs b/mullvad-cli/src/cmds/status.rs index 12ad4d65be..f3750962f6 100644 --- a/mullvad-cli/src/cmds/status.rs +++ b/mullvad-cli/src/cmds/status.rs @@ -14,6 +14,12 @@ impl Command for Status { fn clap_subcommand(&self) -> clap::App<'static, 'static> { clap::SubCommand::with_name(self.name()) .about("View the state of the VPN tunnel") + .arg( + clap::Arg::with_name("location") + .long("location") + .short("l") + .help("Prints the current location and IP. Based on GeoIP lookups"), + ) .subcommand( clap::SubCommand::with_name("listen") .about("Listen for VPN tunnel state changes") @@ -30,7 +36,10 @@ impl Command for Status { let state = rpc.get_state()?; print_state(&state); - print_location(&mut rpc)?; + if matches.is_present("location") { + print_location(&mut rpc)?; + } + if let Some(listen_matches) = matches.subcommand_matches("listen") { let verbose = listen_matches.is_present("verbose"); let subscription = rpc @@ -43,7 +52,11 @@ impl Command for Status { print_state(&new_state); use self::TunnelState::*; match new_state { - Connected { .. } | Disconnected => print_location(&mut rpc)?, + Connected { .. } | Disconnected => { + if matches.is_present("location") { + print_location(&mut rpc)?; + } + } _ => {} } } |
