about summary refs log tree commit diff
path: root/clippy_dev/src/main.rs
diff options
context:
space:
mode:
authorxFrednet <xFrednet@gmail.com>2021-06-16 18:59:28 +0200
committerflip1995 <philipp.krones@embecosm.com>2021-06-25 11:17:00 +0200
commitb48f041befdca6ad14acfda2db68c280ee3fbc85 (patch)
tree4fd318849c144030811c9604d3da9b937bb91744 /clippy_dev/src/main.rs
parent3d0984975e555e122499e58d3fbc20e99b7be589 (diff)
downloadrust-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.rs13
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(