Skip to content

Commit

Permalink
Do not always print version information to stdout
Browse files Browse the repository at this point in the history
Signed-off-by: David McNeil <mcneil.david2@gmail.com>
  • Loading branch information
davidMcneil committed Jul 10, 2020
1 parent 7127653 commit 95327d7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,12 +1599,11 @@ where

fn _version(&self, use_long: bool) -> Error {
debugln!("Parser::_version: ");
let out = io::stdout();
let mut buf_w = BufWriter::new(out.lock());
match self.print_version(&mut buf_w, use_long) {
let mut buf = vec![];
match self.print_version(&mut buf, use_long) {
Err(e) => e,
_ => Error {
message: String::new(),
message: String::from_utf8(buf).unwrap_or_default(),
kind: ErrorKind::VersionDisplayed,
info: None,
},
Expand Down

0 comments on commit 95327d7

Please sign in to comment.