cli diagnostics walk files

This commit is contained in:
Josh Mcguigan
2020-04-14 04:35:34 -07:00
parent f62c73a972
commit f9701efbe7
3 changed files with 51 additions and 50 deletions

View File

@@ -38,6 +38,9 @@ pub(crate) enum Command {
Diagnostics {
path: PathBuf,
load_output_dirs: bool,
/// Include files which are not modules. In rust-analyzer
/// this would include the parser test files.
all: bool,
},
RunServer,
Version,
@@ -225,6 +228,7 @@ USAGE:
FLAGS:
-h, --help Prints help information
--load-output-dirs Load OUT_DIR values by running `cargo check` before analysis
--all Include all files rather than only modules
ARGS:
<PATH>"
@@ -233,6 +237,7 @@ ARGS:
}
let load_output_dirs = matches.contains("--load-output-dirs");
let all = matches.contains("--all");
let path = {
let mut trailing = matches.free()?;
if trailing.len() != 1 {
@@ -241,7 +246,7 @@ ARGS:
trailing.pop().unwrap().into()
};
Command::Diagnostics { path, load_output_dirs }
Command::Diagnostics { path, load_output_dirs, all }
}
_ => {
eprintln!(

View File

@@ -39,8 +39,8 @@ fn main() -> Result<()> {
cli::analysis_bench(args.verbosity, path.as_ref(), what, load_output_dirs)?
}
args::Command::Diagnostics { path, load_output_dirs } => {
cli::diagnostics(path.as_ref(), load_output_dirs)?
args::Command::Diagnostics { path, load_output_dirs, all } => {
cli::diagnostics(path.as_ref(), load_output_dirs, all)?
}
args::Command::RunServer => run_server()?,