diff --git a/phantun/Cargo.toml b/phantun/Cargo.toml index a2506dd..134b5b1 100644 --- a/phantun/Cargo.toml +++ b/phantun/Cargo.toml @@ -11,7 +11,7 @@ Transforms UDP stream into (fake) TCP streams that can go through Layer 3 & Layer 4 (NAPT) firewalls/NATs. """ [dependencies] -clap = "2.34" +clap = { version = "3.0", features = ["cargo"] } socket2 = { version = "0.4", features = ["all"] } fake-tcp = "0.2" tokio = { version = "1.14", features = ["full"] } diff --git a/phantun/src/bin/client.rs b/phantun/src/bin/client.rs index b723ecc..57a73fe 100644 --- a/phantun/src/bin/client.rs +++ b/phantun/src/bin/client.rs @@ -42,8 +42,8 @@ async fn main() { .version(crate_version!()) .author("Datong Sun (github.com/dndx)") .arg( - Arg::with_name("local") - .short("l") + Arg::new("local") + .short('l') .long("local") .required(true) .value_name("IP:PORT") @@ -51,8 +51,8 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("remote") - .short("r") + Arg::new("remote") + .short('r') .long("remote") .required(true) .value_name("IP or HOST NAME:PORT") @@ -60,7 +60,7 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("tun") + Arg::new("tun") .long("tun") .required(false) .value_name("tunX") @@ -69,7 +69,7 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("tun_local") + Arg::new("tun_local") .long("tun-local") .required(false) .value_name("IP") @@ -78,7 +78,7 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("tun_peer") + Arg::new("tun_peer") .long("tun-peer") .required(false) .value_name("IP") diff --git a/phantun/src/bin/server.rs b/phantun/src/bin/server.rs index 70267dd..431720e 100644 --- a/phantun/src/bin/server.rs +++ b/phantun/src/bin/server.rs @@ -16,8 +16,8 @@ async fn main() { .version(crate_version!()) .author("Datong Sun (github.com/dndx)") .arg( - Arg::with_name("local") - .short("l") + Arg::new("local") + .short('l') .long("local") .required(true) .value_name("PORT") @@ -25,8 +25,8 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("remote") - .short("r") + Arg::new("remote") + .short('r') .long("remote") .required(true) .value_name("IP or HOST NAME:PORT") @@ -34,7 +34,7 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("tun") + Arg::new("tun") .long("tun") .required(false) .value_name("tunX") @@ -43,7 +43,7 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("tun_local") + Arg::new("tun_local") .long("tun-local") .required(false) .value_name("IP") @@ -52,7 +52,7 @@ async fn main() { .takes_value(true), ) .arg( - Arg::with_name("tun_peer") + Arg::new("tun_peer") .long("tun-peer") .required(false) .value_name("IP")