From 0ecb11ea7b7bdfdd70cafc69feb75fe1e559bc31 Mon Sep 17 00:00:00 2001 From: Andrey Golovizin Date: Wed, 28 Sep 2022 11:34:42 +0200 Subject: [PATCH] Update clap to 4.0.0 --- Cargo.lock | 42 ++++++------------------------------------ Cargo.toml | 2 +- src/main.rs | 14 +++++++------- 3 files changed, 14 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abc771b..f100e2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,12 +34,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - [[package]] name = "azirevpn" version = "0.1.0" @@ -93,26 +87,24 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clap" -version = "3.2.22" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "422592638015fe46332afb8fbf9361d9fa2d498d05c0c384e28710b4639e33a5" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "677ca5a153ca1804d4bf3e9d45f0f6b5ba4f950de155e373d457cd5f154cca9c" dependencies = [ "heck", "proc-macro-error", @@ -123,9 +115,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", ] @@ -171,12 +163,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "heck" version = "0.4.0" @@ -208,16 +194,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.5.0" @@ -458,12 +434,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" - [[package]] name = "tinyvec" version = "1.6.0" diff --git a/Cargo.toml b/Cargo.toml index 546e074..f0943ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" [dependencies] anyhow = "1.0.65" -clap = { version = "3.2.22", features = ["derive"] } +clap = { version = "4.0.0", features = ["derive"] } env_logger = "0.9.1" ipnet = "2.5.0" log = "0.4.17" diff --git a/src/main.rs b/src/main.rs index 07fb1d5..1224d3b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,20 +4,20 @@ use std::process; use log::debug; -use clap::Parser; +use clap::{Parser, Subcommand}; use serde::{Deserialize, Serialize}; const BASE_URL: &str = "https://api.azirevpn.com/v1"; /// AzireVPN client #[derive(Parser, Debug)] -#[clap(version)] +#[command(version)] struct Opts { /// Enables JSON output - #[clap(short, long)] + #[arg(short, long)] json: bool, - #[clap(subcommand)] + #[command(subcommand)] command: Command, } @@ -27,14 +27,14 @@ struct ConfigOpts { username: String, token: String, - #[clap(short, long)] + #[arg(short, long)] no_dns: bool, - #[clap(short = '4', long)] + #[arg(short = '4', long)] no_ipv6: bool, } -#[derive(Parser, Debug)] +#[derive(Subcommand, Debug)] enum Command { /// Prints the list of VPN endpoints Endpoints,