From 66bd1ffa327b4b1691a260107ef53a7ef112c8ea Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Aug 2018 03:50:40 +0300 Subject: no-dump for perf --- cli/src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cli/src/main.rs') diff --git a/cli/src/main.rs b/cli/src/main.rs index a3a317c69..e5b1aae46 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -32,15 +32,20 @@ fn main() -> Result<()> { .takes_value(true), ), ) - .subcommand(SubCommand::with_name("parse")) + .subcommand( + SubCommand::with_name("parse") + .arg(Arg::with_name("no-dump").long("--no-dump")) + ) .subcommand(SubCommand::with_name("symbols")) .get_matches(); match matches.subcommand() { - ("parse", _) => { + ("parse", Some(matches)) => { let start = Instant::now(); let file = file()?; let elapsed = start.elapsed(); - println!("{}", file.syntax_tree()); + if !matches.is_present("no-dump") { + println!("{}", file.syntax_tree()); + } eprintln!("parsing: {:?}", elapsed); } ("symbols", _) => { -- cgit v1.2.3