File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -394,9 +394,8 @@ fn print_usage_to_stdout(opts: &Options, reason: &str) {
394
394
format ! ( "{}\n \n " , reason)
395
395
} ;
396
396
let msg = format ! (
397
- "{}Format Rust code\n \n usage: {} [options] <file>..." ,
398
- sep,
399
- env:: args_os( ) . next( ) . unwrap( ) . to_string_lossy( )
397
+ "{}Format Rust code\n \n usage: rustfmt [options] <file>..." ,
398
+ sep
400
399
) ;
401
400
println ! ( "{}" , opts. usage( & msg) ) ;
402
401
}
Original file line number Diff line number Diff line change @@ -106,3 +106,12 @@ fn inline_config() {
106
106
&& contains( "format_strings = true" )
107
107
) ;
108
108
}
109
+
110
+ #[ test]
111
+ fn rustfmt_usage_text ( ) {
112
+ let args = [
113
+ "--help" ,
114
+ ] ;
115
+ let ( stdout, _) = rustfmt ( & args) ;
116
+ assert ! ( stdout. contains( & format!( "Format Rust code\n \n usage: rustfmt [options] <file>..." ) ) ) ;
117
+ }
You can’t perform that action at this time.
0 commit comments