summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli/src/cmds/connect.rs
blob: b7cf7cd8c502ecab142a2656a691aa33bbff0168 (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 clap;
use new_rpc_client;
use Command;
use Result;


pub struct Connect;

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")
    }

    fn run(&self, _matches: &clap::ArgMatches) -> Result<()> {
        let mut rpc = new_rpc_client()?;
        rpc.connect()?;
        Ok(())
    }
}