aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-07 01:50:40 +0100
committerAleksey Kladov <[email protected]>2018-08-07 01:50:40 +0100
commit66bd1ffa327b4b1691a260107ef53a7ef112c8ea (patch)
tree7296b0ac7ea99db26c29df996a85da8f446d054e /cli
parent50a7daa042c5f652cd724de55a056f9785a22a85 (diff)
no-dump for perf
Diffstat (limited to 'cli')
-rw-r--r--cli/src/main.rs11
1 files changed, 8 insertions, 3 deletions
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<()> {
32 .takes_value(true), 32 .takes_value(true),
33 ), 33 ),
34 ) 34 )
35 .subcommand(SubCommand::with_name("parse")) 35 .subcommand(
36 SubCommand::with_name("parse")
37 .arg(Arg::with_name("no-dump").long("--no-dump"))
38 )
36 .subcommand(SubCommand::with_name("symbols")) 39 .subcommand(SubCommand::with_name("symbols"))
37 .get_matches(); 40 .get_matches();
38 match matches.subcommand() { 41 match matches.subcommand() {
39 ("parse", _) => { 42 ("parse", Some(matches)) => {
40 let start = Instant::now(); 43 let start = Instant::now();
41 let file = file()?; 44 let file = file()?;
42 let elapsed = start.elapsed(); 45 let elapsed = start.elapsed();
43 println!("{}", file.syntax_tree()); 46 if !matches.is_present("no-dump") {
47 println!("{}", file.syntax_tree());
48 }
44 eprintln!("parsing: {:?}", elapsed); 49 eprintln!("parsing: {:?}", elapsed);
45 } 50 }
46 ("symbols", _) => { 51 ("symbols", _) => {