diff options
author | Joscha <joscha@plugh.de> | 2022-09-29 12:47:02 +0200 |
---|---|---|
committer | Joscha <joscha@plugh.de> | 2022-09-29 13:06:06 +0200 |
commit | 3895388e548d6793a220942cfc20a171d2ffc350 (patch) | |
tree | e9e80f4e828563c5ea5b25bfcbfaf74c18b93d58 | |
parent | ec34a45f2b6c225bcd2053509c52c0f14ad06d83 (diff) |
Update to clap 4.0
-rw-r--r-- | Cargo.lock | 30 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/export.rs | 8 | ||||
-rw-r--r-- | src/main.rs | 16 |
4 files changed, 19 insertions, 37 deletions
@@ -109,26 +109,24 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.2.22" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ca689d7434ce44517a12a89456b2be4d1ea1cafcd8f581978c03d45f5a5c12a7" dependencies = [ "heck", "proc-macro-error", @@ -139,9 +137,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", ] @@ -488,16 +486,6 @@ dependencies = [ ] [[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1076,12 +1064,6 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" - -[[package]] name = "thiserror" version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6,7 +6,7 @@ edition = "2021" [dependencies] anyhow = "1.0.65" async-trait = "0.1.57" -clap = { version = "3.2.22", features = ["derive"] } +clap = { version = "4.0.2", features = ["derive", "deprecated"] } cookie = "0.16.1" crossterm = "0.25.0" directories = "4.0.1" diff --git a/src/export.rs b/src/export.rs index 75ad782..c76009c 100644 --- a/src/export.rs +++ b/src/export.rs @@ -37,11 +37,11 @@ pub struct Args { rooms: Vec<String>, /// Export all rooms. - #[clap(long, short)] + #[arg(long, short)] all: bool, /// Format of the output file. - #[clap(long, short, value_enum, default_value_t = Format::Text)] + #[arg(long, short, value_enum, default_value_t = Format::Text)] format: Format, /// Location of the output file @@ -55,8 +55,8 @@ pub struct Args { /// `%r.%e` will be appended. /// /// Must be a valid utf-8 encoded string. - #[clap(long, short, default_value_t = Into::into("%r.%e"))] - #[clap(verbatim_doc_comment)] + #[arg(long, short, default_value_t = Into::into("%r.%e"))] + #[arg(verbatim_doc_comment)] out: String, } diff --git a/src/main.rs b/src/main.rs index fccc68d..2412ef4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ use vault::Vault; use crate::config::Config; use crate::logger::Logger; -#[derive(Debug, clap::Subcommand)] +#[derive(Debug, clap::Parser)] enum Command { /// Run the client interactively (default). Run, @@ -60,34 +60,34 @@ impl Default for Command { } #[derive(Debug, clap::Parser)] -#[clap(version)] +#[command(version)] struct Args { /// Path to the config file. /// /// Relative paths are interpreted relative to the current directory. - #[clap(long, short)] + #[arg(long, short)] config: Option<PathBuf>, /// Path to a directory for cove to store its data in. /// /// Relative paths are interpreted relative to the current directory. - #[clap(long, short)] + #[arg(long, short)] data_dir: Option<PathBuf>, /// If set, cove won't store data permanently. - #[clap(long, short, action)] + #[arg(long, short)] ephemeral: bool, /// If set, cove will ignore the autojoin config option. - #[clap(long, short, action)] + #[arg(long, short)] offline: bool, /// Measure the width of characters as displayed by the terminal emulator /// instead of guessing the width. - #[clap(long, short, action)] + #[arg(long, short)] measure_widths: bool, - #[clap(subcommand)] + #[command(subcommand)] command: Option<Command>, } |