diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 4 | ||||
-rw-r--r-- | crates/ra_cli/src/main.rs | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index 86ee0cb63..e6b2b30c6 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -7,9 +7,9 @@ use ra_syntax::AstNode; | |||
7 | 7 | ||
8 | use crate::Result; | 8 | use crate::Result; |
9 | 9 | ||
10 | pub fn run(verbose: bool, only: Option<&str>) -> Result<()> { | 10 | pub fn run(verbose: bool, path: &str, only: Option<&str>) -> Result<()> { |
11 | let db_load_time = Instant::now(); | 11 | let db_load_time = Instant::now(); |
12 | let (db, roots) = BatchDatabase::load_cargo(".")?; | 12 | let (db, roots) = BatchDatabase::load_cargo(path)?; |
13 | println!("Database loaded, {} roots, {:?}", roots.len(), db_load_time.elapsed()); | 13 | println!("Database loaded, {} roots, {:?}", roots.len(), db_load_time.elapsed()); |
14 | let analysis_time = Instant::now(); | 14 | let analysis_time = Instant::now(); |
15 | let mut num_crates = 0; | 15 | let mut num_crates = 0; |
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 11790d2e7..5a8136823 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs | |||
@@ -25,7 +25,8 @@ fn main() -> Result<()> { | |||
25 | .subcommand( | 25 | .subcommand( |
26 | SubCommand::with_name("analysis-stats") | 26 | SubCommand::with_name("analysis-stats") |
27 | .arg(Arg::with_name("verbose").short("v")) | 27 | .arg(Arg::with_name("verbose").short("v")) |
28 | .arg(Arg::with_name("only").short("o").takes_value(true)), | 28 | .arg(Arg::with_name("only").short("o").takes_value(true)) |
29 | .arg(Arg::with_name("path")), | ||
29 | ) | 30 | ) |
30 | .get_matches(); | 31 | .get_matches(); |
31 | match matches.subcommand() { | 32 | match matches.subcommand() { |
@@ -53,8 +54,9 @@ fn main() -> Result<()> { | |||
53 | } | 54 | } |
54 | ("analysis-stats", Some(matches)) => { | 55 | ("analysis-stats", Some(matches)) => { |
55 | let verbose = matches.is_present("verbose"); | 56 | let verbose = matches.is_present("verbose"); |
57 | let path = matches.value_of("path").unwrap_or(""); | ||
56 | let only = matches.value_of("only"); | 58 | let only = matches.value_of("only"); |
57 | analysis_stats::run(verbose, only)?; | 59 | analysis_stats::run(verbose, path, only)?; |
58 | } | 60 | } |
59 | _ => unreachable!(), | 61 | _ => unreachable!(), |
60 | } | 62 | } |