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) {
394394 format ! ( "{}\n \n " , reason)
395395 } ;
396396 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
400399 ) ;
401400 println ! ( "{}" , opts. usage( & msg) ) ;
402401}
Original file line number Diff line number Diff line change @@ -106,3 +106,12 @@ fn inline_config() {
106106 && contains( "format_strings = true" )
107107 ) ;
108108}
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