Skip to content

Commit

Permalink
fix: flush the buffer in App::print_version()
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-gulyas committed Sep 18, 2015
1 parent 320209c commit cbc42a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbc42a3

Please sign in to comment.