@@ -8,54 +8,54 @@ use std::fs::File;
8
8
use std:: io:: { BufReader , BufWriter } ;
9
9
use std:: { path:: PathBuf , time:: Duration } ;
10
10
11
+ use clap:: Parser ;
11
12
use prettytable:: { Cell , Row , Table } ;
12
13
use serde:: Serialize ;
13
- use structopt:: StructOpt ;
14
14
15
15
mod aggregate;
16
16
mod diff;
17
17
18
- #[ derive( StructOpt , Debug ) ]
18
+ #[ derive( Parser , Debug ) ]
19
19
struct AggregateOpt {
20
20
files : Vec < PathBuf > ,
21
21
}
22
22
23
- #[ derive( StructOpt , Debug ) ]
23
+ #[ derive( Parser , Debug ) ]
24
24
struct DiffOpt {
25
25
base : PathBuf ,
26
26
change : PathBuf ,
27
27
28
- #[ structopt ( short = "e" , long = "exclude" ) ]
28
+ #[ clap ( short = 'e' , long = "exclude" ) ]
29
29
exclude : Vec < String > ,
30
30
31
- #[ structopt ( long = "json" ) ]
31
+ #[ clap ( long = "json" ) ]
32
32
json : bool ,
33
33
}
34
34
35
- #[ derive( StructOpt , Debug ) ]
35
+ #[ derive( Parser , Debug ) ]
36
36
struct SummarizeOpt {
37
37
file_prefix : PathBuf ,
38
38
39
39
/// Writes the analysis to a json file next to <file_prefix> instead of stdout
40
- #[ structopt ( long = "json" ) ]
40
+ #[ clap ( long = "json" ) ]
41
41
json : bool ,
42
42
43
43
/// Filter the output to items whose self-time is greater than this value
44
- #[ structopt ( short = "pa" , long = "percent-above" , default_value = "0.0" ) ]
44
+ #[ clap ( short = 'p' , long = "percent-above" , default_value = "0.0" ) ]
45
45
percent_above : f64 ,
46
46
}
47
47
48
- #[ derive( StructOpt , Debug ) ]
48
+ #[ derive( Parser , Debug ) ]
49
49
enum Opt {
50
50
/// Processes a set of trace files with identical events and analyze variance
51
- #[ structopt ( name = "aggregate" ) ]
51
+ #[ clap ( name = "aggregate" ) ]
52
52
Aggregate ( AggregateOpt ) ,
53
53
54
- #[ structopt ( name = "diff" ) ]
54
+ #[ clap ( name = "diff" ) ]
55
55
Diff ( DiffOpt ) ,
56
56
57
57
/// Processes trace files and produces a summary
58
- #[ structopt ( name = "summarize" ) ]
58
+ #[ clap ( name = "summarize" ) ]
59
59
Summarize ( SummarizeOpt ) ,
60
60
}
61
61
0 commit comments