summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-07-07 14:20:27 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-07-07 14:20:27 +0200
commitec4d8bd1a5e35bd2f653042d673079dec20e9f49 (patch)
tree9f8f482b236e321bb617eff87c1582723d769fa8
parent0aef8955e6a67849d9559d2bae82a1ed2c2694ba (diff)
downloadmullvadvpn-ec4d8bd1a5e35bd2f653042d673079dec20e9f49.tar.xz
mullvadvpn-ec4d8bd1a5e35bd2f653042d673079dec20e9f49.zip
Remove clap dependency in set account method
-rw-r--r--mullvad_cli/src/cmds/account.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/mullvad_cli/src/cmds/account.rs b/mullvad_cli/src/cmds/account.rs
index bb4d75055f..c6300e0eb3 100644
--- a/mullvad_cli/src/cmds/account.rs
+++ b/mullvad_cli/src/cmds/account.rs
@@ -26,7 +26,8 @@ impl Command for Account {
fn run(&self, matches: &clap::ArgMatches) -> Result<()> {
if let Some(set_matches) = matches.subcommand_matches("set") {
- self.set(set_matches)
+ let token = value_t_or_exit!(set_matches.value_of("token"), String);
+ self.set(&token)
} else if let Some(_matches) = matches.subcommand_matches("get") {
self.get()
} else {
@@ -36,9 +37,8 @@ impl Command for Account {
}
impl Account {
- fn set(&self, matches: &clap::ArgMatches) -> Result<()> {
- let token = value_t_or_exit!(matches.value_of("token"), String);
- rpc::call("set_account", &[&token]).map(
+ fn set(&self, token: &str) -> Result<()> {
+ rpc::call("set_account", &[token]).map(
|_| {
println!("Mullvad account {} set", token);
},