From 0d41244481a9062439b5c2146ee8a66ab4db287b Mon Sep 17 00:00:00 2001 From: koushiro Date: Wed, 12 Oct 2022 14:13:24 +0800 Subject: [PATCH 1/2] Update clap to v4 Signed-off-by: koushiro --- Cargo.toml | 2 +- misc/keygen/Cargo.toml | 2 +- misc/keygen/src/main.rs | 2 +- protocols/autonat/Cargo.toml | 2 +- protocols/dcutr/Cargo.toml | 2 +- protocols/relay/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e2cdb52d618..65d2abcf4a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -138,7 +138,7 @@ libp2p-gossipsub = { version = "0.42.1", path = "protocols/gossipsub", optional async-std = { version = "1.6.2", features = ["attributes"] } async-trait = "0.1" env_logger = "0.9.0" -clap = { version = "3.1.6", features = ["derive"] } +clap = { version = "4.0.13", features = ["derive"] } tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] } [workspace] diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index 13b1ff38216..420247b985e 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] -clap = {version = "3.1.6", features = ["derive"]} +clap = { version = "4.0.13", features = ["derive"] } zeroize = "1" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" diff --git a/misc/keygen/src/main.rs b/misc/keygen/src/main.rs index 7c2de2a181c..4d298477513 100644 --- a/misc/keygen/src/main.rs +++ b/misc/keygen/src/main.rs @@ -27,7 +27,7 @@ enum Command { /// Read from config file From { /// Provide a IPFS config file - #[clap(parse(from_os_str))] + #[clap(value_parser)] config: PathBuf, }, /// Generate random diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index ed117c9edf4..c3b88583839 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -28,5 +28,5 @@ prost = "0.11" [dev-dependencies] async-std = { version = "1.10", features = ["attributes"] } env_logger = "0.9" -clap = {version = "3.1.6", features = ["derive"]} +clap = { version = "4.0.13", features = ["derive"] } libp2p = { path = "../..", features = ["full"] } diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index dbdf9494d9b..d9cc5861bc5 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -32,4 +32,4 @@ prost-build = "0.11" env_logger = "0.9.0" libp2p = { path = "../..", features = ["full"] } rand = "0.8" -clap = {version = "3.1.6", features = ["derive"]} +clap = { version = "4.0.13", features = ["derive"] } diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index 052eb1127a8..19837380355 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -36,4 +36,4 @@ prost-build = "0.11" env_logger = "0.9.0" libp2p = { path = "../..", features = ["full"] } quickcheck = { package = "quickcheck-ext", path = "../../misc/quickcheck-ext" } -clap = {version = "3.1.6", features = ["derive"]} +clap = { version = "4.0.13", features = ["derive"] } From 44ecdeaa636c53a093ae8108e6c846539451e01c Mon Sep 17 00:00:00 2001 From: koushiro Date: Thu, 13 Oct 2022 11:33:26 +0800 Subject: [PATCH 2/2] Fix Signed-off-by: koushiro --- protocols/dcutr/examples/dcutr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/dcutr/examples/dcutr.rs b/protocols/dcutr/examples/dcutr.rs index 925e03593b5..9e17539d269 100644 --- a/protocols/dcutr/examples/dcutr.rs +++ b/protocols/dcutr/examples/dcutr.rs @@ -60,7 +60,7 @@ struct Opts { remote_peer_id: Option, } -#[derive(Debug, Parser, PartialEq)] +#[derive(Clone, Debug, PartialEq, Parser)] enum Mode { Dial, Listen,