@@ -18,9 +18,9 @@ fn main() {
18
18
if matches. is_present ( "print-only" ) {
19
19
update_lints:: print_lints ( ) ;
20
20
} else if matches. is_present ( "check" ) {
21
- update_lints:: run ( update_lints:: UpdateMode :: Check ) ;
21
+ update_lints:: update ( update_lints:: UpdateMode :: Check ) ;
22
22
} else {
23
- update_lints:: run ( update_lints:: UpdateMode :: Change ) ;
23
+ update_lints:: update ( update_lints:: UpdateMode :: Change ) ;
24
24
}
25
25
} ,
26
26
( "new_lint" , Some ( matches) ) => {
@@ -30,7 +30,7 @@ fn main() {
30
30
matches. value_of ( "category" ) ,
31
31
matches. is_present ( "msrv" ) ,
32
32
) {
33
- Ok ( _) => update_lints:: run ( update_lints:: UpdateMode :: Change ) ,
33
+ Ok ( _) => update_lints:: update ( update_lints:: UpdateMode :: Change ) ,
34
34
Err ( e) => eprintln ! ( "Unable to create lint: {}" , e) ,
35
35
}
36
36
} ,
@@ -59,6 +59,12 @@ fn main() {
59
59
let filename = matches. value_of ( "filename" ) . unwrap ( ) ;
60
60
lint:: run ( filename) ;
61
61
} ,
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
+ } ,
62
68
_ => { } ,
63
69
}
64
70
}
@@ -232,5 +238,26 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
232
238
. help ( "The path to a file to lint" ) ,
233
239
) ,
234
240
)
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
+ )
235
262
. get_matches ( )
236
263
}
0 commit comments