diff --git a/Cargo.lock b/Cargo.lock index 0faee2f5..34568e5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -222,15 +222,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anyhow" version = "1.0.52" @@ -449,17 +440,17 @@ dependencies = [ [[package]] name = "clap" -version = "2.34.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "d17bf219fcd37199b9a29e00ba65dfb8cd5b2688b7297ec14ff829c40ac50ca9" dependencies = [ - "ansi_term", "atty", "bitflags", - "strsim 0.8.0", + "indexmap", + "os_str_bytes", + "strsim", + "termcolor", "textwrap", - "unicode-width", - "vec_map", ] [[package]] @@ -587,7 +578,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", + "strsim", "syn", ] @@ -1426,6 +1417,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -2095,12 +2095,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.10.0" @@ -2182,12 +2176,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.11.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" [[package]] name = "thiserror" @@ -2449,12 +2440,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - [[package]] name = "unicode-xid" version = "0.2.2" @@ -2489,12 +2474,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "vergen" version = "6.0.0" diff --git a/Cargo.toml b/Cargo.toml index 678defbe..3365cf2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ anyhow = "1.0.52" actix-web = "4.0.0-beta.18" async-trait = "0.1.52" bytes = "1.1.0" -clap = "2.34.0" +clap = "3.0.0" cloudflare = "0.9.0" domain = { version = "0.6.1", features = ["master"] } env_logger = "0.9.0" diff --git a/src/main.rs b/src/main.rs index 78bf6a98..3df0eda9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,8 +51,8 @@ async fn main() -> std::io::Result<()> { .author(env!("CARGO_PKG_AUTHORS")) .about(env!("CARGO_PKG_DESCRIPTION")) .arg( - Arg::with_name("config") - .short("c") + Arg::new("config") + .short('c') .long("config") .value_name("FILE") .default_value("./config.toml") @@ -60,22 +60,22 @@ async fn main() -> std::io::Result<()> { .takes_value(true), ) .arg( - Arg::with_name("debug") + Arg::new("debug") .long("debug") - .short("d") + .short('d') .help("print debug information verbosely"), ) - .subcommand(clap::SubCommand::with_name("srv").about("start server")) + .subcommand(clap::App::new("srv").about("start server")) .subcommand( - clap::SubCommand::with_name("add") + clap::App::new("add") .about("add kuso subdomain") - .arg(Arg::with_name("subdomain").required(true).help("subdomain")) - .arg(Arg::with_name("target").required(true).help("target URL")), + .arg(Arg::new("subdomain").required(true).help("subdomain")) + .arg(Arg::new("target").required(true).help("target URL")), ) .subcommand( - clap::SubCommand::with_name("delete") + clap::App::new("delete") .about("delete kuso subdomain") - .arg(Arg::with_name("subdomain").required(true).help("subdomain")), + .arg(Arg::new("subdomain").required(true).help("subdomain")), ) .get_matches();