diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-12-06 12:33:31 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-12-06 12:33:31 +0100 |
| commit | 8fea1d94f3bbcc02c3822dd43da9a1133e90f715 (patch) | |
| tree | c571ad0e3fb19726b5e0fbe9df641885ddf0524d /clippy_dev/src/main.rs | |
| parent | 35a0060aba4bc9ff4e2b8faa20b91762c3109b18 (diff) | |
Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup
Diffstat (limited to 'clippy_dev/src/main.rs')
| -rw-r--r-- | clippy_dev/src/main.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index b5c04efce3b..30a241c8ba1 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -3,7 +3,7 @@ #![warn(rust_2018_idioms, unused_lifetimes)] use clap::{App, AppSettings, Arg, ArgMatches, SubCommand}; -use clippy_dev::{bless, fmt, new_lint, serve, setup, update_lints}; +use clippy_dev::{bless, fmt, lint, new_lint, serve, setup, update_lints}; fn main() { let matches = get_clap_config(); @@ -55,6 +55,10 @@ fn main() { let lint = matches.value_of("lint"); serve::run(port, lint); }, + ("lint", Some(matches)) => { + let filename = matches.value_of("filename").unwrap(); + lint::run(filename); + }, _ => {}, } } @@ -219,5 +223,14 @@ fn get_clap_config<'a>() -> ArgMatches<'a> { ) .arg(Arg::with_name("lint").help("Which lint's page to load initially (optional)")), ) + .subcommand( + SubCommand::with_name("lint") + .about("Manually run clippy on a file") + .arg( + Arg::with_name("filename") + .required(true) + .help("The path to a file to lint"), + ), + ) .get_matches() } |
