Skip to content

Commit cbc42a3

Browse files
committed
fix: flush the buffer in App::print_version()
1 parent 320209c commit cbc42a3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/app.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1845,10 +1845,12 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
18451845
-> io::Result<()> {
18461846
// Print the binary name if existing, but replace all spaces with hyphens in case we're
18471847
// dealing with subcommands i.e. git mv is translated to git-mv
1848-
writeln!(w, "{} {}", &self.bin_name.clone().unwrap_or(
1848+
try!(writeln!(w, "{} {}", &self.bin_name.clone().unwrap_or(
18491849
self.name.clone())[..].replace(" ", "-"),
18501850
self.version.unwrap_or("")
1851-
)
1851+
));
1852+
1853+
w.flush()
18521854
}
18531855

18541856
// Reports and error to stderr along with an optional usage statement and optionally quits

0 commit comments

Comments
 (0)