]> git.lizzy.rs Git - rust.git/blobdiff - clippy_dev/src/main.rs
Shrink the size of Rvalue by 16 bytes
[rust.git] / clippy_dev / src / main.rs
index 2ea56c42fafd62316adc779fa60b5922b70ced30..505d465760c57873b1c840ba769276e86b78f00e 100644 (file)
@@ -3,6 +3,9 @@
 use clap::{App, Arg, ArgMatches, SubCommand};
 use clippy_dev::{bless, fmt, new_lint, ra_setup, serve, stderr_length_check, update_lints};
 
+#[cfg(feature = "lintcheck")]
+use clippy_dev::lintcheck;
+
 fn main() {
     let matches = get_clap_config();
 
@@ -10,6 +13,10 @@ fn main() {
         ("bless", Some(matches)) => {
             bless::bless(matches.is_present("ignore-timestamp"));
         },
+        #[cfg(feature = "lintcheck")]
+        ("lintcheck", Some(matches)) => {
+            lintcheck::run(&matches);
+        },
         ("fmt", Some(matches)) => {
             fmt::run(matches.is_present("check"), matches.is_present("verbose"));
         },
@@ -46,7 +53,33 @@ fn main() {
 }
 
 fn get_clap_config<'a>() -> ArgMatches<'a> {
-    App::new("Clippy developer tooling")
+    #[cfg(feature = "lintcheck")]
+    let lintcheck_sbcmd = SubCommand::with_name("lintcheck")
+        .about("run clippy on a set of crates and check output")
+        .arg(
+            Arg::with_name("only")
+                .takes_value(true)
+                .value_name("CRATE")
+                .long("only")
+                .help("only process a single crate of the list"),
+        )
+        .arg(
+            Arg::with_name("crates-toml")
+                .takes_value(true)
+                .value_name("CRATES-SOURCES-TOML-PATH")
+                .long("crates-toml")
+                .help("set the path for a crates.toml where lintcheck should read the sources from"),
+        )
+        .arg(
+            Arg::with_name("threads")
+                .takes_value(true)
+                .value_name("N")
+                .short("j")
+                .long("jobs")
+                .help("number of threads to use, 0 automatic choice"),
+        );
+
+    let app = App::new("Clippy developer tooling")
         .subcommand(
             SubCommand::with_name("bless")
                 .about("bless the test output changes")
@@ -163,6 +196,10 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
                         .validator_os(serve::validate_port),
                 )
                 .arg(Arg::with_name("lint").help("Which lint's page to load initially (optional)")),
-        )
-        .get_matches()
+        );
+
+    #[cfg(feature = "lintcheck")]
+    let app = app.subcommand(lintcheck_sbcmd);
+
+    app.get_matches()
 }