From b02576d5623478526328b4716b1fd9c5c2efd637 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Jan 2020 14:11:18 +0100 Subject: Simplify help for internal tools does not worth the duplication --- xtask/src/help.rs | 13 ------------- xtask/src/main.rs | 36 ++++-------------------------------- 2 files changed, 4 insertions(+), 45 deletions(-) (limited to 'xtask') diff --git a/xtask/src/help.rs b/xtask/src/help.rs index f4e25dcde..9c78ba37f 100644 --- a/xtask/src/help.rs +++ b/xtask/src/help.rs @@ -27,19 +27,6 @@ FLAGS: --jemalloc --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 = "error: The argument `--server` cannot be used with `--client-code` diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 9cefad925..b42946a4c 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -70,42 +70,14 @@ fn main() -> Result<()> { install(opts)? } "codegen" => { - if matches.contains(["-h", "--help"]) { - help::print_no_param_subcommand_help(&subcommand); - return Ok(()); - } codegen::generate_syntax(Mode::Overwrite)?; codegen::generate_parser_tests(Mode::Overwrite)?; codegen::generate_assists_docs(Mode::Overwrite)?; } - "format" => { - if matches.contains(["-h", "--help"]) { - help::print_no_param_subcommand_help(&subcommand); - return Ok(()); - } - 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()? - } + "format" => run_rustfmt(Mode::Overwrite)?, + "install-pre-commit-hook" => install_pre_commit_hook()?, + "lint" => run_clippy()?, + "fuzz-tests" => run_fuzzer()?, _ => eprintln!("{}", help::GLOBAL_HELP), } Ok(()) -- cgit v1.2.3