]> git.lizzy.rs Git - rust.git/blobdiff - clippy_dev/src/main.rs
Update lint documentation to use markdown headlines
[rust.git] / clippy_dev / src / main.rs
index 70c3d93ed47333a4c1249f804212f3479b74f22b..ff324ff6ee6fff5b6a38edc9aaefc6ee09df0f34 100644 (file)
@@ -37,14 +37,20 @@ fn main() {
             stderr_length_check::check();
         },
         ("setup", Some(sub_command)) => match sub_command.subcommand() {
-            ("intellij", Some(matches)) => setup::intellij::run(matches.value_of("rustc-repo-path")),
+            ("intellij", Some(matches)) => setup::intellij::setup_rustc_src(
+                matches
+                    .value_of("rustc-repo-path")
+                    .expect("this field is mandatory and therefore always valid"),
+            ),
             ("git-hook", Some(matches)) => setup::git_hook::install_hook(matches.is_present("force-override")),
+            ("vscode-tasks", Some(matches)) => setup::vscode::install_tasks(matches.is_present("force-override")),
             _ => {},
         },
-        ("remove", Some(sub_command)) => {
-            if let ("git-hook", Some(_)) = sub_command.subcommand() {
-                setup::git_hook::remove_hook();
-            }
+        ("remove", Some(sub_command)) => match sub_command.subcommand() {
+            ("git-hook", Some(_)) => setup::git_hook::remove_hook(),
+            ("intellij", Some(_)) => setup::intellij::remove_rustc_src(),
+            ("vscode-tasks", Some(_)) => setup::vscode::remove_tasks(),
+            _ => {},
         },
         ("serve", Some(matches)) => {
             let port = matches.value_of("port").unwrap().parse().unwrap();
@@ -133,6 +139,7 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                         .possible_values(&[
                             "style",
                             "correctness",
+                            "suspicious",
                             "complexity",
                             "perf",
                             "pedantic",
@@ -176,13 +183,29 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                                 .help("Forces the override of an existing git pre-commit hook")
                                 .required(false),
                         ),
+                )
+                .subcommand(
+                    SubCommand::with_name("vscode-tasks")
+                        .about("Add several tasks to vscode for formatting, validation and testing")
+                        .arg(
+                            Arg::with_name("force-override")
+                                .long("force-override")
+                                .short("f")
+                                .help("Forces the override of existing vscode tasks")
+                                .required(false),
+                        ),
                 ),
         )
         .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("git-hook").about("Remove any existing pre-commit git hook"))
+                .subcommand(SubCommand::with_name("vscode-tasks").about("Remove any existing vscode tasks"))
+                .subcommand(
+                    SubCommand::with_name("intellij")
+                        .about("Removes rustc source paths added via `cargo dev setup intellij`"),
+                ),
         )
         .subcommand(
             SubCommand::with_name("serve")