From 4298cdcd4bdad6e5b336057cebe602295bd0c042 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 18 Oct 2022 16:32:51 +0200 Subject: [PATCH] update clap --- Cargo.lock | 20 ++++++-------------- Cargo.toml | 2 +- src/main.rs | 12 ++++++------ 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 770958b..6a57eb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,26 +63,24 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.2.17" +version = "4.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.17" +version = "4.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" dependencies = [ "heck", "proc-macro-error", @@ -93,9 +91,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] @@ -1284,12 +1282,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" - [[package]] name = "thin-slice" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 9554dd5..8fda264 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" edition = "2021" [dependencies] -clap = { version = "3.2", features = ["derive"] } +clap = { version = "4.0.17", features = ["derive"] } reqwest = { version = "0.11" } tokio = { version = ">=1.13.1", features = ["full"] } scraper = "0.13" diff --git a/src/main.rs b/src/main.rs index 54f140d..4932044 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,18 +4,18 @@ mod download; mod parse; #[derive(Parser)] -#[clap(version, about, long_about = None)] +#[command(version, about, long_about = None)] struct Cli { /// Your username - #[clap(value_parser)] + #[arg(value_parser)] username: String, /// Directory output [default: the username] - #[clap(short, long, value_parser, value_name = "DIRECTORY")] + #[arg(short, long, value_parser, value_name = "DIRECTORY")] directory: Option, /// Domain name - #[clap( + #[arg( long, value_parser, value_name = "DOMAIN NAME", @@ -24,11 +24,11 @@ struct Cli { domain: String, /// Scheme: HTTP/HTTPS - #[clap(long, value_parser, default_value = "https")] + #[arg(long, value_parser, default_value = "https")] scheme: String, /// Download special files - #[clap(short, takes_value = false)] + #[arg(short, action = clap::ArgAction::SetTrue)] special_files: bool, }