Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(misc): deprecated #[clap] attributes with #[arg] and #[command] #5932

Merged
merged 3 commits into from
Mar 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ libp2p-quic = { version = "0.12.1", path = "transports/quic" }
libp2p-relay = { version = "0.20.0", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.16.0", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.28.1", path = "protocols/request-response" }
libp2p-server = { version = "0.12.6", path = "misc/server" }
libp2p-server = { version = "0.12.7", path = "misc/server" }
libp2p-stream = { version = "0.3.0-alpha", path = "protocols/stream" }
libp2p-swarm = { version = "0.47.0", path = "swarm" }
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.
10 changes: 5 additions & 5 deletions misc/keygen/src/main.rs
Original file line number Diff line number Diff line change
@@ -16,13 +16,13 @@ use libp2p_identity::PeerId;
use zeroize::Zeroizing;

#[derive(Debug, Parser)]
#[clap(name = "libp2p key material generator")]
#[command(name = "libp2p key material generator")]
struct Args {
/// JSON formatted output
#[clap(long, global = true)]
#[arg(long, global = true)]
json: bool,

#[clap(subcommand)]
#[command(subcommand)]
cmd: Command,
}

@@ -31,13 +31,13 @@ enum Command {
/// Read from config file
From {
/// Provide a IPFS config file
#[clap(value_parser)]
#[arg(value_parser)]
config: PathBuf,
},
/// Generate random
Rand {
/// The keypair prefix
#[clap(long)]
#[arg(long)]
prefix: Option<String>,
},
}
7 changes: 7 additions & 0 deletions misc/server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.12.7

### Changed

- Deprecated #[clap] attributes with #[arg] and #[command].
See [PR 5932](https://github.com/libp2p/rust-libp2p/pull/5932)

## 0.12.6

### Changed
2 changes: 1 addition & 1 deletion misc/server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libp2p-server"
version = "0.12.6"
version = "0.12.7"
authors = ["Max Inden <mail@max-inden.de>"]
edition.workspace = true
repository = "https://github.com/libp2p/rust-libp2p"
10 changes: 5 additions & 5 deletions misc/server/src/main.rs
Original file line number Diff line number Diff line change
@@ -21,22 +21,22 @@ mod config;
mod http_service;

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

/// Metric endpoint path.
#[clap(long, default_value = "/metrics")]
#[arg(long, default_value = "/metrics")]
metrics_path: String,

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

/// Whether to run the libp2p Autonat protocol.
#[clap(long)]
#[arg(long)]
enable_autonat: bool,
}