@@ -19,9 +19,9 @@ fn main() {
1919 if matches. is_present ( "print-only" ) {
2020 update_lints:: print_lints ( ) ;
2121 } else if matches. is_present ( "check" ) {
22- update_lints:: run ( update_lints:: UpdateMode :: Check ) ;
22+ update_lints:: update ( update_lints:: UpdateMode :: Check ) ;
2323 } else {
24- update_lints:: run ( update_lints:: UpdateMode :: Change ) ;
24+ update_lints:: update ( update_lints:: UpdateMode :: Change ) ;
2525 }
2626 } ,
2727 ( "new_lint" , Some ( matches) ) => {
@@ -31,7 +31,7 @@ fn main() {
3131 matches. value_of ( "category" ) ,
3232 matches. is_present ( "msrv" ) ,
3333 ) {
34- Ok ( _) => update_lints:: run ( update_lints:: UpdateMode :: Change ) ,
34+ Ok ( _) => update_lints:: update ( update_lints:: UpdateMode :: Change ) ,
3535 Err ( e) => eprintln ! ( "Unable to create lint: {}" , e) ,
3636 }
3737 } ,
@@ -78,6 +78,12 @@ fn main() {
7878 let path = matches. value_of ( "path" ) . unwrap ( ) ;
7979 lint:: run ( path) ;
8080 } ,
81+ ( "rename_lint" , Some ( matches) ) => {
82+ let old_name = matches. value_of ( "old_name" ) . unwrap ( ) ;
83+ let new_name = matches. value_of ( "new_name" ) . unwrap_or ( old_name) ;
84+ let uplift = matches. is_present ( "uplift" ) ;
85+ update_lints:: rename ( old_name, new_name, uplift) ;
86+ } ,
8187 _ => { } ,
8288 }
8389}
@@ -279,5 +285,26 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
279285 . help ( "The path to a file or package directory to lint" ) ,
280286 ) ,
281287 )
288+ . subcommand (
289+ SubCommand :: with_name ( "rename_lint" )
290+ . about ( "Renames the given lint" )
291+ . arg (
292+ Arg :: with_name ( "old_name" )
293+ . index ( 1 )
294+ . required ( true )
295+ . help ( "The name of the lint to rename" ) ,
296+ )
297+ . arg (
298+ Arg :: with_name ( "new_name" )
299+ . index ( 2 )
300+ . required_unless ( "uplift" )
301+ . help ( "The new name of the lint" ) ,
302+ )
303+ . arg (
304+ Arg :: with_name ( "uplift" )
305+ . long ( "uplift" )
306+ . help ( "This lint will be uplifted into rustc" ) ,
307+ ) ,
308+ )
282309 . get_matches ( )
283310}
0 commit comments