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/main.rs | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'xtask/src/main.rs') 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