diff options
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/main.rs | 11 |
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", _) => { |