diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-09-27 15:16:55 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-09-27 15:16:55 +0200 |
| commit | 763d5e200947d616865ec3292c27347739d2d386 (patch) | |
| tree | eb7db04951974780a61c0c4ad948c5e1c3b360fa /mullvad-cli/src | |
| parent | 00b0ba04092e97f3724260b943f3b138e8eb7b01 (diff) | |
| download | mullvadvpn-763d5e200947d616865ec3292c27347739d2d386.tar.xz mullvadvpn-763d5e200947d616865ec3292c27347739d2d386.zip | |
Reformat with rustfmt 0.99.5
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/cmds/account.rs | 6 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/auto_connect.rs | 3 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/lan.rs | 3 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 39 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/tunnel.rs | 18 |
5 files changed, 46 insertions, 23 deletions
diff --git a/mullvad-cli/src/cmds/account.rs b/mullvad-cli/src/cmds/account.rs index 4d42c8c226..1beee454c7 100644 --- a/mullvad-cli/src/cmds/account.rs +++ b/mullvad-cli/src/cmds/account.rs @@ -22,10 +22,12 @@ impl Command for Account { .help("The Mullvad account token to configure the client with") .required(true), ), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("get") .about("Display information about the currently configured account"), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("unset") .about("Removes the account number from the settings"), ) diff --git a/mullvad-cli/src/cmds/auto_connect.rs b/mullvad-cli/src/cmds/auto_connect.rs index 7117c0f2aa..5d043f0f9b 100644 --- a/mullvad-cli/src/cmds/auto_connect.rs +++ b/mullvad-cli/src/cmds/auto_connect.rs @@ -21,7 +21,8 @@ impl Command for AutoConnect { .required(true) .possible_values(&["on", "off"]), ), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("get") .about("Display the current auto-connect setting"), ) diff --git a/mullvad-cli/src/cmds/lan.rs b/mullvad-cli/src/cmds/lan.rs index 80a50a5047..2c833533cf 100644 --- a/mullvad-cli/src/cmds/lan.rs +++ b/mullvad-cli/src/cmds/lan.rs @@ -20,7 +20,8 @@ impl Command for Lan { .required(true) .possible_values(&["allow", "block"]), ), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("get") .about("Display the current local network sharing setting"), ) diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index 70efb6362a..eda57070fb 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -26,7 +26,8 @@ impl Command for Relay { clap::SubCommand::with_name("set") .about( "Set relay server selection parameters. Such as location and port/protocol", - ).setting(clap::AppSettings::SubcommandRequired) + ) + .setting(clap::AppSettings::SubcommandRequired) .subcommand( clap::SubCommand::with_name("custom") .about("Set a custom VPN relay") @@ -35,46 +36,55 @@ impl Command for Relay { .required(true) .index(1) .possible_values(&["openvpn", "wireguard"]), - ).arg( + ) + .arg( clap::Arg::with_name("host") .help("Hostname or IP") .required(true) .index(2), - ).arg( + ) + .arg( clap::Arg::with_name("port") .help("Remote network port") .required(true) .index(3), - ).arg( + ) + .arg( clap::Arg::with_name("protocol") .help("Transport protocol. For Wireguard this is ignored.") .index(4) .default_value("udp") .possible_values(&["udp", "tcp"]), ), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("location") .about( "Set country or city to select relays from. Use the 'list' \ command to show available alternatives.", - ).arg( + ) + .arg( clap::Arg::with_name("country") .help( "The two letter country code, or 'any' for no preference.", - ).required(true) + ) + .required(true) .index(1) .validator(country_code_validator), - ).arg( + ) + .arg( clap::Arg::with_name("city") .help("The three letter city code") .index(2) .validator(city_code_validator), - ).arg( + ) + .arg( clap::Arg::with_name("hostname") .help("The relay hostname") .index(3), ), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("tunnel") .about("Set tunnel constraints") .arg(clap::Arg::with_name("port").required(true).index(1)) @@ -85,7 +95,8 @@ impl Command for Relay { .possible_values(&["any", "udp", "tcp"]), ), ), - ).subcommand(clap::SubCommand::with_name("get")) + ) + .subcommand(clap::SubCommand::with_name("get")) .subcommand( clap::SubCommand::with_name("list").about("List available countries and cities"), ) @@ -150,7 +161,8 @@ impl Relay { ("any", ..) => clap::Error::with_description( "City can't be given when selecting 'any' country", clap::ErrorKind::InvalidValue, - ).exit(), + ) + .exit(), (country, None, None) => { Constraint::Only(LocationConstraint::Country(country.to_owned())) } @@ -168,7 +180,8 @@ impl Relay { (..) => clap::Error::with_description( "Invalid country, city and hostname combination given", clap::ErrorKind::InvalidValue, - ).exit(), + ) + .exit(), }; self.update_constraints(RelaySettingsUpdate::Normal(RelayConstraintsUpdate { diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs index fee9188c5d..8d601cd345 100644 --- a/mullvad-cli/src/cmds/tunnel.rs +++ b/mullvad-cli/src/cmds/tunnel.rs @@ -26,14 +26,18 @@ impl Command for Tunnel { .help( "Sets the optional mssfix parameter. \ Set an empty string to clear it.", - ).required(true), + ) + .required(true), ), - ).setting(clap::AppSettings::SubcommandRequired), - ).subcommand( + ) + .setting(clap::AppSettings::SubcommandRequired), + ) + .subcommand( clap::SubCommand::with_name("get") .help("Retrieves the current setting for mssfix"), ), - ).subcommand( + ) + .subcommand( clap::SubCommand::with_name("set") .subcommand( clap::SubCommand::with_name("ipv6").arg( @@ -42,8 +46,10 @@ impl Command for Tunnel { .takes_value(true) .possible_values(&["on", "off"]), ), - ).setting(clap::AppSettings::SubcommandRequired), - ).subcommand( + ) + .setting(clap::AppSettings::SubcommandRequired), + ) + .subcommand( clap::SubCommand::with_name("get") .help("Retrieves the current setting for common tunnel options"), ) |
