File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -25,5 +25,5 @@ env_logger = "0.10.0"
25
25
26
26
[dev-dependencies]
27
27
rayon = "1.8.0"
28
- structopt = "0.3.26"
28
+ clap = { version = "4", features = ["derive"] }
29
29
byte-unit = "4.0.19"
Original file line number Diff line number Diff line change @@ -18,18 +18,18 @@ use byte_unit::Byte;
18
18
use cmd_lib::*;
19
19
use rayon::prelude::*;
20
20
use std::time::Instant;
21
- use structopt::StructOpt ;
21
+ use clap::Parser ;
22
22
23
23
const DATA_SIZE: u64 = 10 * 1024 * 1024 * 1024; // 10GB data
24
24
25
- #[derive(StructOpt )]
26
- #[structopt (name = "dd_test", about = "Get disk read bandwidth.")]
25
+ #[derive(Parser )]
26
+ #[clap (name = "dd_test", about = "Get disk read bandwidth.")]
27
27
struct Opt {
28
- #[structopt (short, default_value = "4096")]
28
+ #[clap (short, default_value = "4096")]
29
29
block_size: u64,
30
- #[structopt (short, default_value = "1")]
30
+ #[clap (short, default_value = "1")]
31
31
thread_num: u64,
32
- #[structopt (short)]
32
+ #[clap (short)]
33
33
file: String,
34
34
}
35
35
@@ -39,7 +39,7 @@ fn main() -> CmdResult {
39
39
block_size,
40
40
thread_num,
41
41
file,
42
- } = Opt::from_args ();
42
+ } = Opt::parse ();
43
43
44
44
run_cmd! (
45
45
info "Dropping caches at first";
You can’t perform that action at this time.
0 commit comments