Merge pull request #629 from sfackler/usage

Use argv[0] for usage output
This commit is contained in:
Nick Cameron 2015-11-20 15:09:42 +13:00
commit 7eabbeb424

View File

@ -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));
}