Allow targeting a specific function with analysis-stats

This can be useful for debugging.
This commit is contained in:
Florian Diebold 2019-05-07 12:09:10 +02:00
parent 4083caa233
commit 880ef25a9e
2 changed files with 12 additions and 4 deletions

View file

@ -23,7 +23,9 @@ fn main() -> Result<()> {
.subcommand(SubCommand::with_name("parse").arg(Arg::with_name("no-dump").long("--no-dump")))
.subcommand(SubCommand::with_name("symbols"))
.subcommand(
SubCommand::with_name("analysis-stats").arg(Arg::with_name("verbose").short("v")),
SubCommand::with_name("analysis-stats")
.arg(Arg::with_name("verbose").short("v"))
.arg(Arg::with_name("only").short("o").takes_value(true)),
)
.get_matches();
match matches.subcommand() {
@ -51,7 +53,8 @@ fn main() -> Result<()> {
}
("analysis-stats", Some(matches)) => {
let verbose = matches.is_present("verbose");
analysis_stats::run(verbose)?;
let only = matches.value_of("only");
analysis_stats::run(verbose, only)?;
}
_ => unreachable!(),
}