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"
2525
2626[dev-dependencies ]
2727rayon = " 1.8.0"
28- structopt = " 0.3.26 "
28+ clap = { version = " 4 " , features = [ " derive " ] }
2929byte-unit = " 4.0.19"
Original file line number Diff line number Diff line change @@ -18,18 +18,18 @@ use byte_unit::Byte;
1818use cmd_lib:: * ;
1919use rayon:: prelude:: * ;
2020use std:: time:: Instant ;
21- use structopt :: StructOpt ;
21+ use clap :: Parser ;
2222
2323const DATA_SIZE : u64 = 10 * 1024 * 1024 * 1024 ; // 10GB data
2424
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." ) ]
2727struct Opt {
28- #[ structopt ( short, default_value = "4096" ) ]
28+ #[ clap ( short, default_value = "4096" ) ]
2929 block_size : u64 ,
30- #[ structopt ( short, default_value = "1" ) ]
30+ #[ clap ( short, default_value = "1" ) ]
3131 thread_num : u64 ,
32- #[ structopt ( short) ]
32+ #[ clap ( short) ]
3333 file : String ,
3434}
3535
@@ -39,7 +39,7 @@ fn main() -> CmdResult {
3939 block_size,
4040 thread_num,
4141 file,
42- } = Opt :: from_args ( ) ;
42+ } = Opt :: parse ( ) ;
4343
4444 run_cmd ! (
4545 info "Dropping caches at first" ;
You can’t perform that action at this time.
0 commit comments