Skip to content

Commit 88f7875

Browse files
authored
fix(misc): deprecated #[clap] attributes with #[arg] and #[command]
follow up: #5930 Pull-Request: #5932.
1 parent 72f6da9 commit 88f7875

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ libp2p-quic = { version = "0.12.1", path = "transports/quic" }
100100
libp2p-relay = { version = "0.20.0", path = "protocols/relay" }
101101
libp2p-rendezvous = { version = "0.16.0", path = "protocols/rendezvous" }
102102
libp2p-request-response = { version = "0.28.1", path = "protocols/request-response" }
103-
libp2p-server = { version = "0.12.6", path = "misc/server" }
103+
libp2p-server = { version = "0.12.7", path = "misc/server" }
104104
libp2p-stream = { version = "0.3.0-alpha", path = "protocols/stream" }
105105
libp2p-swarm = { version = "0.47.0", path = "swarm" }
106106
libp2p-swarm-derive = { version = "=0.35.1", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required.

misc/keygen/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ use libp2p_identity::PeerId;
1616
use zeroize::Zeroizing;
1717

1818
#[derive(Debug, Parser)]
19-
#[clap(name = "libp2p key material generator")]
19+
#[command(name = "libp2p key material generator")]
2020
struct Args {
2121
/// JSON formatted output
22-
#[clap(long, global = true)]
22+
#[arg(long, global = true)]
2323
json: bool,
2424

25-
#[clap(subcommand)]
25+
#[command(subcommand)]
2626
cmd: Command,
2727
}
2828

@@ -31,13 +31,13 @@ enum Command {
3131
/// Read from config file
3232
From {
3333
/// Provide a IPFS config file
34-
#[clap(value_parser)]
34+
#[arg(value_parser)]
3535
config: PathBuf,
3636
},
3737
/// Generate random
3838
Rand {
3939
/// The keypair prefix
40-
#[clap(long)]
40+
#[arg(long)]
4141
prefix: Option<String>,
4242
},
4343
}

misc/server/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.12.7
2+
3+
### Changed
4+
5+
- Deprecated #[clap] attributes with #[arg] and #[command].
6+
See [PR 5932](https://github.com/libp2p/rust-libp2p/pull/5932)
7+
18
## 0.12.6
29

310
### Changed

misc/server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libp2p-server"
3-
version = "0.12.6"
3+
version = "0.12.7"
44
authors = ["Max Inden <[email protected]>"]
55
edition.workspace = true
66
repository = "https://github.com/libp2p/rust-libp2p"

misc/server/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ mod config;
2121
mod http_service;
2222

2323
#[derive(Debug, Parser)]
24-
#[clap(name = "libp2p server", about = "A rust-libp2p server binary.")]
24+
#[command(name = "libp2p server", about = "A rust-libp2p server binary.")]
2525
struct Opts {
2626
/// Path to IPFS config file.
27-
#[clap(long)]
27+
#[arg(long)]
2828
config: PathBuf,
2929

3030
/// Metric endpoint path.
31-
#[clap(long, default_value = "/metrics")]
31+
#[arg(long, default_value = "/metrics")]
3232
metrics_path: String,
3333

3434
/// Whether to run the libp2p Kademlia protocol and join the IPFS DHT.
35-
#[clap(long)]
35+
#[arg(long)]
3636
enable_kademlia: bool,
3737

3838
/// Whether to run the libp2p Autonat protocol.
39-
#[clap(long)]
39+
#[arg(long)]
4040
enable_autonat: bool,
4141
}
4242

0 commit comments

Comments
 (0)