Simplify
help for internal tools does not worth the duplication
This commit is contained in:
parent
8f1792fde2
commit
b02576d562
@ -27,19 +27,6 @@ FLAGS:
|
|||||||
--jemalloc
|
--jemalloc
|
||||||
--server";
|
--server";
|
||||||
|
|
||||||
pub fn print_no_param_subcommand_help(subcommand: &str) {
|
|
||||||
eprintln!(
|
|
||||||
"ra_tools-{}
|
|
||||||
|
|
||||||
USAGE:
|
|
||||||
ra_tools {}
|
|
||||||
|
|
||||||
FLAGS:
|
|
||||||
-h, --help Prints help information",
|
|
||||||
subcommand, subcommand
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const INSTALL_RA_CONFLICT: &str =
|
pub const INSTALL_RA_CONFLICT: &str =
|
||||||
"error: The argument `--server` cannot be used with `--client-code`
|
"error: The argument `--server` cannot be used with `--client-code`
|
||||||
|
|
||||||
|
@ -70,42 +70,14 @@ fn main() -> Result<()> {
|
|||||||
install(opts)?
|
install(opts)?
|
||||||
}
|
}
|
||||||
"codegen" => {
|
"codegen" => {
|
||||||
if matches.contains(["-h", "--help"]) {
|
|
||||||
help::print_no_param_subcommand_help(&subcommand);
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
codegen::generate_syntax(Mode::Overwrite)?;
|
codegen::generate_syntax(Mode::Overwrite)?;
|
||||||
codegen::generate_parser_tests(Mode::Overwrite)?;
|
codegen::generate_parser_tests(Mode::Overwrite)?;
|
||||||
codegen::generate_assists_docs(Mode::Overwrite)?;
|
codegen::generate_assists_docs(Mode::Overwrite)?;
|
||||||
}
|
}
|
||||||
"format" => {
|
"format" => run_rustfmt(Mode::Overwrite)?,
|
||||||
if matches.contains(["-h", "--help"]) {
|
"install-pre-commit-hook" => install_pre_commit_hook()?,
|
||||||
help::print_no_param_subcommand_help(&subcommand);
|
"lint" => run_clippy()?,
|
||||||
return Ok(());
|
"fuzz-tests" => run_fuzzer()?,
|
||||||
}
|
|
||||||
run_rustfmt(Mode::Overwrite)?
|
|
||||||
}
|
|
||||||
"install-pre-commit-hook" => {
|
|
||||||
if matches.contains(["-h", "--help"]) {
|
|
||||||
help::print_no_param_subcommand_help(&subcommand);
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
install_pre_commit_hook()?
|
|
||||||
}
|
|
||||||
"lint" => {
|
|
||||||
if matches.contains(["-h", "--help"]) {
|
|
||||||
help::print_no_param_subcommand_help(&subcommand);
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
run_clippy()?
|
|
||||||
}
|
|
||||||
"fuzz-tests" => {
|
|
||||||
if matches.contains(["-h", "--help"]) {
|
|
||||||
help::print_no_param_subcommand_help(&subcommand);
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
run_fuzzer()?
|
|
||||||
}
|
|
||||||
_ => eprintln!("{}", help::GLOBAL_HELP),
|
_ => eprintln!("{}", help::GLOBAL_HELP),
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user