diff options
| author | xFrednet <xFrednet@gmail.com> | 2021-06-16 18:59:28 +0200 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-06-25 11:17:00 +0200 |
| commit | b48f041befdca6ad14acfda2db68c280ee3fbc85 (patch) | |
| tree | 4fd318849c144030811c9604d3da9b937bb91744 /clippy_dev/src/main.rs | |
| parent | 3d0984975e555e122499e58d3fbc20e99b7be589 (diff) | |
| download | rust-b48f041befdca6ad14acfda2db68c280ee3fbc85.tar.gz rust-b48f041befdca6ad14acfda2db68c280ee3fbc85.zip | |
Added the `cargo dev remove` command for convenience
Diffstat (limited to 'clippy_dev/src/main.rs')
| -rw-r--r-- | clippy_dev/src/main.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index faf8700f55a..70c3d93ed47 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -38,9 +38,14 @@ fn main() { }, ("setup", Some(sub_command)) => match sub_command.subcommand() { ("intellij", Some(matches)) => setup::intellij::run(matches.value_of("rustc-repo-path")), - ("git-hook", Some(matches)) => setup::git_hook::run(matches.is_present("force-override")), + ("git-hook", Some(matches)) => setup::git_hook::install_hook(matches.is_present("force-override")), _ => {}, }, + ("remove", Some(sub_command)) => { + if let ("git-hook", Some(_)) = sub_command.subcommand() { + setup::git_hook::remove_hook(); + } + }, ("serve", Some(matches)) => { let port = matches.value_of("port").unwrap().parse().unwrap(); let lint = matches.value_of("lint"); @@ -174,6 +179,12 @@ fn get_clap_config<'a>() -> ArgMatches<'a> { ), ) .subcommand( + SubCommand::with_name("remove") + .about("Support for undoing changes done by the setup command") + .setting(AppSettings::ArgRequiredElseHelp) + .subcommand(SubCommand::with_name("git-hook").about("Remove any existing pre-commit git hook")), + ) + .subcommand( SubCommand::with_name("serve") .about("Launch a local 'ALL the Clippy Lints' website in a browser") .arg( |
