summaryrefslogtreecommitdiffhomepage
path: root/talpid_cli/src/cli.rs
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-03-08 10:37:29 +0100
committerLinus Färnstrand <linus@mullvad.net>2017-03-08 10:37:29 +0100
commitf2cc9fddc38eb7e3c75b2dccff8f135d30425c4d (patch)
tree4fb239d78be4126d11b95e1f841c2dfe858a094c /talpid_cli/src/cli.rs
parent79836cdcddff32feb1c30e0e7035f94ffc16053f (diff)
parent34273d87d72ef5db7bfc240704eb9ea56255764f (diff)
downloadmullvadvpn-f2cc9fddc38eb7e3c75b2dccff8f135d30425c4d.tar.xz
mullvadvpn-f2cc9fddc38eb7e3c75b2dccff8f135d30425c4d.zip
Merge branch 'configurable-plugin-path'
Diffstat (limited to 'talpid_cli/src/cli.rs')
-rw-r--r--talpid_cli/src/cli.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/talpid_cli/src/cli.rs b/talpid_cli/src/cli.rs
index d6d5899846..79a13d94c2 100644
--- a/talpid_cli/src/cli.rs
+++ b/talpid_cli/src/cli.rs
@@ -3,8 +3,17 @@ use std::path::PathBuf;
use talpid_core::net::RemoteAddr;
+#[cfg(all(unix, not(target_os="macos")))]
+const DEFAULT_PLUGIN_PATH: &'static str = "./target/debug/libtalpid_openvpn_plugin.so";
+#[cfg(target_os="macos")]
+const DEFAULT_PLUGIN_PATH: &'static str = "./target/debug/libtalpid_openvpn_plugin.dylib";
+#[cfg(windows)]
+const DEFAULT_PLUGIN_PATH: &'static str = "./target/debug/libtalpid_openvpn_plugin.dll";
+
+
pub struct Args {
pub binary: String,
+ pub plugin_path: PathBuf,
pub config: PathBuf,
pub remotes: Vec<RemoteAddr>,
pub verbosity: u64,
@@ -15,6 +24,7 @@ pub fn parse_args_or_exit() -> Args {
let remotes = values_t!(matches.values_of("remotes"), RemoteAddr).unwrap_or_else(|e| e.exit());
Args {
binary: matches.value_of("openvpn").unwrap().to_owned(),
+ plugin_path: PathBuf::from(matches.value_of("plugin").unwrap()),
config: PathBuf::from(matches.value_of("config").unwrap()),
remotes: remotes,
verbosity: matches.occurrences_of("verbose"),
@@ -48,6 +58,10 @@ fn create_app() -> App<'static, 'static> {
.takes_value(true)
.multiple(true)
.required(true))
+ .arg(Arg::with_name("plugin")
+ .long("plugin")
+ .help("Path to talpid plugin")
+ .default_value(DEFAULT_PLUGIN_PATH))
.arg(Arg::with_name("verbose")
.short("v")
.long("verbose")