mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
fix: flush the buffer in App::print_version()
This commit is contained in:
parent
320209c952
commit
cbc42a37d2
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue