diff options
Diffstat (limited to 'talpid_cli/src/cli.rs')
| -rw-r--r-- | talpid_cli/src/cli.rs | 14 |
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") |
