We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 813d127 commit b05b313Copy full SHA for b05b313
src/bin/main.rs
@@ -394,9 +394,8 @@ fn print_usage_to_stdout(opts: &Options, reason: &str) {
394
format!("{}\n\n", reason)
395
};
396
let msg = format!(
397
- "{}Format Rust code\n\nusage: {} [options] <file>...",
398
- sep,
399
- env::args_os().next().unwrap().to_string_lossy()
+ "{}Format Rust code\n\nusage: rustfmt [options] <file>...",
+ sep
400
);
401
println!("{}", opts.usage(&msg));
402
}
tests/rustfmt/main.rs
@@ -106,3 +106,12 @@ fn inline_config() {
106
&& contains("format_strings = true")
107
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\nusage: rustfmt [options] <file>...")));
117
+}
0 commit comments