@@ -18,9 +18,9 @@ fn main() {
1818 if matches. is_present ( "print-only" ) {
1919 update_lints:: print_lints ( ) ;
2020 } else if matches. is_present ( "check" ) {
21- update_lints:: run ( update_lints:: UpdateMode :: Check ) ;
21+ update_lints:: update ( update_lints:: UpdateMode :: Check ) ;
2222 } else {
23- update_lints:: run ( update_lints:: UpdateMode :: Change ) ;
23+ update_lints:: update ( update_lints:: UpdateMode :: Change ) ;
2424 }
2525 } ,
2626 ( "new_lint" , Some ( matches) ) => {
@@ -30,7 +30,7 @@ fn main() {
3030 matches. value_of ( "category" ) ,
3131 matches. is_present ( "msrv" ) ,
3232 ) {
33- Ok ( _) => update_lints:: run ( update_lints:: UpdateMode :: Change ) ,
33+ Ok ( _) => update_lints:: update ( update_lints:: UpdateMode :: Change ) ,
3434 Err ( e) => eprintln ! ( "Unable to create lint: {}" , e) ,
3535 }
3636 } ,
@@ -59,6 +59,12 @@ fn main() {
5959 let filename = matches. value_of ( "filename" ) . unwrap ( ) ;
6060 lint:: run ( filename) ;
6161 } ,
62+ ( "rename_lint" , Some ( matches) ) => {
63+ let old_name = matches. value_of ( "old_name" ) . unwrap ( ) ;
64+ let new_name = matches. value_of ( "new_name" ) . unwrap_or ( old_name) ;
65+ let uplift = matches. is_present ( "uplift" ) ;
66+ update_lints:: rename ( old_name, new_name, uplift) ;
67+ } ,
6268 _ => { } ,
6369 }
6470}
@@ -232,5 +238,26 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
232238 . help ( "The path to a file to lint" ) ,
233239 ) ,
234240 )
241+ . subcommand (
242+ SubCommand :: with_name ( "rename_lint" )
243+ . about ( "Renames the given lint" )
244+ . arg (
245+ Arg :: with_name ( "old_name" )
246+ . index ( 1 )
247+ . required ( true )
248+ . help ( "The name of the lint to rename" ) ,
249+ )
250+ . arg (
251+ Arg :: with_name ( "new_name" )
252+ . index ( 2 )
253+ . required_unless ( "uplift" )
254+ . help ( "The new name of the lint" ) ,
255+ )
256+ . arg (
257+ Arg :: with_name ( "uplift" )
258+ . long ( "uplift" )
259+ . help ( "This lint will be uplifted into rustc" ) ,
260+ ) ,
261+ )
235262 . get_matches ( )
236263}
0 commit comments