File tree Expand file tree Collapse file tree 6 files changed +24
-24
lines changed Expand file tree Collapse file tree 6 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ use libp2p::{
14
14
use rand:: rngs:: OsRng ;
15
15
16
16
#[ derive( Debug , Parser ) ]
17
- #[ clap ( name = "libp2p autonatv2 server" ) ]
17
+ #[ command ( name = "libp2p autonatv2 server" ) ]
18
18
struct Opt {
19
- #[ clap ( short, long, default_value_t = 0 ) ]
19
+ #[ arg ( short, long, default_value_t = 0 ) ]
20
20
listen_port : u16 ,
21
21
}
22
22
Original file line number Diff line number Diff line change @@ -33,22 +33,22 @@ use libp2p::{
33
33
use tracing_subscriber:: EnvFilter ;
34
34
35
35
#[ derive( Debug , Parser ) ]
36
- #[ clap ( name = "libp2p DCUtR client" ) ]
36
+ #[ command ( name = "libp2p DCUtR client" ) ]
37
37
struct Opts {
38
38
/// The mode (client-listen, client-dial).
39
- #[ clap ( long) ]
39
+ #[ arg ( long) ]
40
40
mode : Mode ,
41
41
42
42
/// Fixed value to generate deterministic peer id.
43
- #[ clap ( long) ]
43
+ #[ arg ( long) ]
44
44
secret_key_seed : u8 ,
45
45
46
46
/// The listening address
47
- #[ clap ( long) ]
47
+ #[ arg ( long) ]
48
48
relay_address : Multiaddr ,
49
49
50
50
/// Peer ID of the remote peer to hole punch to.
51
- #[ clap ( long) ]
51
+ #[ arg ( long) ]
52
52
remote_peer_id : Option < PeerId > ,
53
53
}
54
54
Original file line number Diff line number Diff line change @@ -117,32 +117,32 @@ async fn main() -> Result<(), Box<dyn Error>> {
117
117
}
118
118
119
119
#[ derive( Parser , Debug ) ]
120
- #[ clap ( name = "libp2p file sharing example" ) ]
120
+ #[ command ( name = "libp2p file sharing example" ) ]
121
121
struct Opt {
122
122
/// Fixed value to generate deterministic peer ID.
123
- #[ clap ( long) ]
123
+ #[ arg ( long) ]
124
124
secret_key_seed : Option < u8 > ,
125
125
126
- #[ clap ( long) ]
126
+ #[ arg ( long) ]
127
127
peer : Option < Multiaddr > ,
128
128
129
- #[ clap ( long) ]
129
+ #[ arg ( long) ]
130
130
listen_address : Option < Multiaddr > ,
131
131
132
- #[ clap ( subcommand) ]
132
+ #[ command ( subcommand) ]
133
133
argument : CliArgument ,
134
134
}
135
135
136
136
#[ derive( Debug , Parser ) ]
137
137
enum CliArgument {
138
138
Provide {
139
- #[ clap ( long) ]
139
+ #[ arg ( long) ]
140
140
path : PathBuf ,
141
- #[ clap ( long) ]
141
+ #[ arg ( long) ]
142
142
name : String ,
143
143
} ,
144
144
Get {
145
- #[ clap ( long) ]
145
+ #[ arg ( long) ]
146
146
name : String ,
147
147
} ,
148
148
}
Original file line number Diff line number Diff line change @@ -154,16 +154,16 @@ async fn main() -> Result<()> {
154
154
}
155
155
156
156
#[ derive( Parser , Debug ) ]
157
- #[ clap ( name = "libp2p Kademlia DHT example" ) ]
157
+ #[ command ( name = "libp2p Kademlia DHT example" ) ]
158
158
struct Opt {
159
- #[ clap ( subcommand) ]
159
+ #[ command ( subcommand) ]
160
160
argument : CliArgument ,
161
161
}
162
162
163
163
#[ derive( Debug , Parser ) ]
164
164
enum CliArgument {
165
165
GetPeers {
166
- #[ clap ( long) ]
166
+ #[ arg ( long) ]
167
167
peer_id : Option < PeerId > ,
168
168
} ,
169
169
PutPkRecord { } ,
Original file line number Diff line number Diff line change @@ -119,17 +119,17 @@ fn generate_ed25519(secret_key_seed: u8) -> identity::Keypair {
119
119
}
120
120
121
121
#[ derive( Debug , Parser ) ]
122
- #[ clap ( name = "libp2p relay" ) ]
122
+ #[ command ( name = "libp2p relay" ) ]
123
123
struct Opt {
124
124
/// Determine if the relay listen on ipv6 or ipv4 loopback address. the default is ipv4
125
- #[ clap ( long) ]
125
+ #[ arg ( long) ]
126
126
use_ipv6 : Option < bool > ,
127
127
128
128
/// Fixed value to generate deterministic peer id
129
- #[ clap ( long) ]
129
+ #[ arg ( long) ]
130
130
secret_key_seed : u8 ,
131
131
132
132
/// The port used to listen on all interfaces
133
- #[ clap ( long) ]
133
+ #[ arg ( long) ]
134
134
port : u16 ,
135
135
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ use tracing_subscriber::EnvFilter;
35
35
use web_time:: { Duration , Instant } ;
36
36
37
37
#[ derive( Debug , Parser ) ]
38
- #[ clap ( name = "libp2p perf client" ) ]
38
+ #[ command ( name = "libp2p perf client" ) ]
39
39
struct Opts {
40
40
#[ arg( long) ]
41
41
server_address : Option < SocketAddr > ,
@@ -47,7 +47,7 @@ struct Opts {
47
47
download_bytes : Option < usize > ,
48
48
49
49
/// Run in server mode.
50
- #[ clap ( long) ]
50
+ #[ arg ( long) ]
51
51
run_server : bool ,
52
52
}
53
53
You can’t perform that action at this time.
0 commit comments