blob: 6fc7072580333a3717f9a54b87abad04a4a9fc82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
use crate::{new_rpc_client, Command, Result};
use talpid_types::ErrorExt;
pub struct Connect;
#[mullvad_management_interface::async_trait]
impl Command for Connect {
fn name(&self) -> &'static str {
"connect"
}
fn clap_subcommand(&self) -> clap::App<'static, 'static> {
clap::SubCommand::with_name(self.name())
.about("Command the client to start establishing a VPN tunnel")
}
async fn run(&self, _: &clap::ArgMatches<'_>) -> Result<()> {
let mut rpc = new_rpc_client().await?;
if let Err(e) = rpc.connect_tunnel(()).await {
eprintln!("{}", e.display_chain());
}
Ok(())
}
}
|