Skip to content

Commit

Permalink
imp: removes extra newline when printing version
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed May 30, 2016
1 parent a86d6aa commit 7e2e2cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/parser.rs
Expand Up @@ -1542,22 +1542,22 @@ impl<'a, 'b> Parser<'a, 'b>
w.flush().map_err(Error::from)
}

fn write_version<W: Write>(&self, w: &mut W) -> io::Result<()> {
pub fn write_version<W: Write>(&self, w: &mut W) -> io::Result<()> {
if let Some(bn) = self.meta.bin_name.as_ref() {
if bn.contains(' ') {
// Incase we're dealing with subcommands i.e. git mv is translated to git-mv
writeln!(w,
write!(w,
"{} {}",
bn.replace(" ", "-"),
self.meta.version.unwrap_or("".into()))
} else {
writeln!(w,
write!(w,
"{} {}",
&self.meta.name[..],
self.meta.version.unwrap_or("".into()))
}
} else {
writeln!(w,
write!(w,
"{} {}",
&self.meta.name[..],
self.meta.version.unwrap_or("".into()))
Expand Down

0 comments on commit 7e2e2cb

Please sign in to comment.