mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
Use argv[0] for usage output
Usage messages traditionally use this as it contains the path that the user provided to run the executable (e.g. `rustfmt` instead of `/usr/local/bin/rustfmt`).
This commit is contained in:
parent
f09aa85798
commit
d7b331bea7
@ -164,7 +164,7 @@ fn main() {
|
||||
fn print_usage(opts: &Options, reason: &str) {
|
||||
let reason = format!("{}\nusage: {} [options] <file>...",
|
||||
reason,
|
||||
env::current_exe().unwrap().display());
|
||||
env::args_os().next().unwrap().to_string_lossy());
|
||||
println!("{}", opts.usage(&reason));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user