fix: flush the buffer in App::print_version()

This commit is contained in:
Alex Gulyás 2015-09-18 23:56:30 +02:00
parent 320209c952
commit cbc42a37d2

View file

@ -1845,10 +1845,12 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
-> io::Result<()> {
// Print the binary name if existing, but replace all spaces with hyphens in case we're
// dealing with subcommands i.e. git mv is translated to git-mv
writeln!(w, "{} {}", &self.bin_name.clone().unwrap_or(
try!(writeln!(w, "{} {}", &self.bin_name.clone().unwrap_or(
self.name.clone())[..].replace(" ", "-"),
self.version.unwrap_or("")
)
));
w.flush()
}
// Reports and error to stderr along with an optional usage statement and optionally quits